Skip to content

Commit d74c953

Browse files
committed
wip: long awaited refresh
1 parent f7cf064 commit d74c953

13 files changed

Lines changed: 2493 additions & 701 deletions

File tree

Cargo.lock

Lines changed: 1104 additions & 438 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,47 @@ name = "wsx"
33
description = "Cilki's WorkSpace eXplorer"
44
version = "0.1.0"
55
edition = "2021"
6+
authors = ["cilki"]
67
repository = "https://github.com/cilki/wsx/"
8+
readme = "README.md"
9+
keywords = ["git", "workspace", "cli", "repository", "manager"]
10+
categories = ["command-line-utilities", "development-tools"]
711

812
[dependencies]
9-
anyhow = "1.0.82"
10-
cmd_lib = "1.3.0"
11-
enum_dispatch = "0.3.13"
13+
anyhow = "1"
14+
cmd_lib = "1"
15+
crossterm = { version = "0.28", optional = true }
16+
enum_dispatch = "0.3"
1217
git-repository = { version = "0", optional = true }
13-
home = "0.5.9"
14-
log = "0.4.17"
15-
pico-args = "0.5.0"
18+
home = "0.5"
19+
log = "0.4"
20+
pico-args = "0.5"
21+
ratatui = { version = "0.29", optional = true }
1622
regex = "1"
1723
serde = { version = "1", features = ["derive"] }
18-
sha2 = "0.10.6"
24+
serde_json = { version = "1", optional = true }
25+
sha2 = "0.10"
1926
toml = "0"
20-
tracing = "0.1.40"
21-
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
27+
tracing = "0.1"
28+
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
2229
walkdir = "2"
2330

31+
[dev-dependencies]
32+
tempfile = "3"
33+
2434
[build-dependencies]
25-
built = { version = "0.7", features = ["cargo-lock", "dependency-tree", "git2", "chrono", "semver"] }
35+
built = { version = "0.7", features = [
36+
"cargo-lock",
37+
"dependency-tree",
38+
"git2",
39+
"chrono",
40+
"semver",
41+
] }
2642

2743
[features]
44+
default = ["github", "gitlab", "tui"]
45+
github = ["dep:serde_json"]
46+
gitlab = []
47+
tui = ["dep:crossterm", "dep:ratatui"]
48+
# Note: git_oxide feature currently has compilation issues with git-repository dependency
2849
git_oxide = ["dep:git-repository"]

README.md

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,31 @@
11
# WorkSpace eXplorer
22

3-
`wsx` is a command line utility for quickly cloning (and decloning) Git repositories
4-
into a local directory called a _workspace_.
3+
`wsx` is a command line utility for quickly cloning (and decloning) Git
4+
repositories into a local directory called a _workspace_.
55

66
### Workspaces
77

8-
Simply defined, a _working set_ is the set of all repositories you're able to work
9-
on at any given time. Even more simply, your _workspace_ is just the local directory
10-
where you keep your Git repositories.
8+
Simply defined, a _working set_ is the set of all repositories you're able to
9+
work on at any given time. Even more simply, your _workspace_ is just the local
10+
directory where you keep your Git repositories.
1111

12-
The principle behind `wsx` is that your Git workspace should only consist of your
13-
_working set_. This reduces unnecessary noise as repositories accumulate in your
14-
workspace over time and improves indexing performance of your development tools.
15-
Adhering to this principle involves frequently cloning and deleting repositories
16-
from your workspace, which is exactly what `wsx` is designed to automate.
12+
The principle behind `wsx` is that your Git workspace should only consist of
13+
your _working set_. This reduces unnecessary noise as repositories accumulate in
14+
your workspace over time and improves indexing performance of your development
15+
tools. Adhering to this principle involves frequently cloning and deleting
16+
repositories from your workspace, which is exactly what `wsx` is designed to
17+
automate.
1718

1819
When repositories are dropped from your workspace, they are cached locally so
1920
restoring them later can be done in an instant.
2021

2122
### Keep your working set clean
2223

2324
```sh
24-
# Clone a repository into the default workspace
25+
# Initialize a workspace in your current directory
26+
wsx init
27+
28+
# Clone a repository
2529
wsx clone github.com/cilki/wsx
2630

2731
# The repository's local path always reflects the remote path for identifiability
@@ -42,18 +46,17 @@ wsx drop github.com/cilki --force
4246
wsx clone github.com/cilki/wsx
4347
```
4448

45-
### Simple configuration
49+
### TUI Mode
4650

47-
`wsx` attempts to read a configuration file from `~/.config/wsx.toml`. For example:
51+
Run `wsx` without arguments to launch an interactive TUI that lets you browse
52+
and select repositories from your configured remotes:
4853

49-
```toml
50-
# Define any number of workspaces
51-
[[workspace]]
52-
name = "personal"
53-
path = "/home/user/workspace"
54+
```sh
55+
# Launch interactive repository browser
56+
wsx
5457

55-
[[workspace]]
56-
name = "work"
57-
path = "/home/worker/workspace"
58+
# Use j/k or arrow keys to navigate
59+
# Press / to search/filter repositories
60+
# Press Enter to clone the selected repository
61+
# Press q to quit
5862
```
59-

shell.nix

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{ pkgs ? import (fetchTarball
2+
"https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz") { } }:
3+
4+
with pkgs;
5+
6+
mkShell rec {
7+
nativeBuildInputs = [ pkg-config cargo rustc rust-analyzer rustfmt clippy ];
8+
buildInputs = [ ];
9+
LD_LIBRARY_PATH = lib.makeLibraryPath buildInputs;
10+
}
11+

src/cmd/drop.rs

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/cmd/mod.rs

Lines changed: 0 additions & 77 deletions
This file was deleted.

src/cmd/open.rs

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)