Skip to content

Commit dd069e9

Browse files
committed
chore: publish de-cli with readme demo
1 parent 1ebae00 commit dd069e9

9 files changed

Lines changed: 137 additions & 6 deletions

File tree

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
/target
2+
demo/*.termctrl
3+
demo/*.mp4

‎Cargo.lock‎

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

‎Cargo.toml‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
2-
name = "de"
3-
version = "0.1.0"
2+
name = "de-cli"
3+
version = "0.1.1"
44
edition = "2024"
55
rust-version = "1.88"
66
description = "A tiny inline directory explorer for your shell"
@@ -11,6 +11,14 @@ readme = "README.md"
1111
keywords = ["cli", "directory", "terminal", "tui"]
1212
categories = ["command-line-utilities"]
1313

14+
[lib]
15+
name = "de"
16+
path = "src/lib.rs"
17+
18+
[[bin]]
19+
name = "de"
20+
path = "src/main.rs"
21+
1422
[dependencies]
1523
chrono = { version = "0.4", default-features = false, features = ["clock"] }
1624
clap = { version = "4.5", features = ["derive"] }

‎README.md‎

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
directory, lets you walk into or out of folders, and changes the shell's working
55
directory only when you confirm.
66

7+
![Navigating directories with de](demo/de.gif)
8+
79
At normal terminal widths, the left pane is the directory you are currently
810
exploring and the right pane previews the highlighted destination. Below 58
911
columns, `de` collapses to a single pane instead of squeezing the listings.
@@ -15,10 +17,11 @@ delete, rename, copy, edit, or open commands.
1517

1618
## Install
1719

18-
Install the latest source directly with Cargo:
20+
Install from crates.io with Cargo (the package is named `de-cli`, but the
21+
installed command is `de`):
1922

2023
```sh
21-
cargo install --git https://github.com/reyamira/de --locked
24+
cargo install de-cli --locked
2225
```
2326

2427
Prebuilt archives for Linux and macOS on x86-64 and ARM64 are available from
@@ -203,6 +206,18 @@ cargo clippy --all-targets --all-features -- -D warnings
203206
cargo test
204207
```
205208

209+
The README demo is driven by the checked-in Terminal Control tape. To replay it
210+
after building the release binary:
211+
212+
```sh
213+
cargo build --release
214+
termctrl play demo/de.tape
215+
```
216+
217+
The tape creates and removes its own synthetic fixture under `/tmp`; its private
218+
`.termctrl` timeline and intermediate MP4 are gitignored. `demo/de.gif` is the
219+
small public artifact embedded above.
220+
206221
The UI is rendered on stderr so stdout remains a clean selected-path protocol
207222
for the shell wrapper. On Unix, path bytes are preserved by the executable; like
208223
most command-substitution integrations, directories whose names end in newline

‎demo/de-edit.json‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"clips": [
3+
{
4+
"from": "ready",
5+
"to": "done",
6+
"caption": "Explore, filter, and cd without leaving the terminal"
7+
}
8+
]
9+
}

‎demo/de.gif‎

237 KB
Loading

‎demo/de.tape‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Rebuild the binary, then replay with: termctrl play demo/de.tape
2+
Session de-readme-demo
3+
Viewport 92 10
4+
Cell 9 18
5+
Cwd ".."
6+
Env TERM "xterm-256color"
7+
Record "de.termctrl"
8+
Color always
9+
Setup "/bin/bash" "demo/fixture.sh" "setup"
10+
Cleanup "/bin/bash" "demo/fixture.sh" "cleanup"
11+
Launch "/bin/bash" "demo/shell.sh"
12+
13+
Wait "de-demo workspace $"
14+
Sleep 800ms
15+
Mark ready
16+
Type "de" Pace 100ms
17+
Key enter
18+
Wait "workspace"
19+
Mark picker
20+
Sleep 1200ms
21+
Key down
22+
Sleep 650ms
23+
Key up
24+
Key right
25+
Wait "api"
26+
Sleep 900ms
27+
Key down
28+
Sleep 500ms
29+
Key up
30+
Sleep 350ms
31+
Key right
32+
Wait "src"
33+
Sleep 900ms
34+
Key left
35+
Wait "api"
36+
Sleep 700ms
37+
Type "/test" Pace 120ms
38+
Sleep 900ms
39+
Mark filtered
40+
Key escape
41+
Sleep 500ms
42+
Key enter
43+
Wait "de-demo api $"
44+
Mark done
45+
Sleep 1400ms
46+
Stop

‎demo/fixture.sh‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
demo_root=/tmp/de-readme-demo
5+
6+
case "${1:-}" in
7+
setup)
8+
rm -rf -- "$demo_root"
9+
mkdir -p \
10+
"$demo_root/config/de" \
11+
"$demo_root/workspace/api/src" \
12+
"$demo_root/workspace/api/tests" \
13+
"$demo_root/workspace/docs/guides" \
14+
"$demo_root/workspace/frontend/components" \
15+
"$demo_root/workspace/frontend/pages"
16+
touch \
17+
"$demo_root/workspace/api/Cargo.toml" \
18+
"$demo_root/workspace/api/README.md" \
19+
"$demo_root/workspace/api/src/main.rs" \
20+
"$demo_root/workspace/api/tests/health.rs" \
21+
"$demo_root/workspace/docs/guides/getting-started.md" \
22+
"$demo_root/workspace/frontend/package.json"
23+
printf '%s\n' \
24+
'[theme]' \
25+
'selected = "ocean"' \
26+
'' \
27+
'[display]' \
28+
'modified = false' \
29+
> "$demo_root/config/de/config.toml"
30+
;;
31+
cleanup)
32+
rm -rf -- "$demo_root"
33+
;;
34+
*)
35+
printf 'usage: %s setup|cleanup\n' "$0" >&2
36+
exit 2
37+
;;
38+
esac

‎demo/shell.sh‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
repo_root=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)
5+
export PATH="$repo_root/target/release:$PATH"
6+
export XDG_CONFIG_HOME=/tmp/de-readme-demo/config
7+
export PS1=$'\e[38;5;81mde-demo\e[0m \W $ '
8+
9+
eval "$(command de init bash)"
10+
export -f de
11+
12+
cd /tmp/de-readme-demo/workspace
13+
exec bash --noprofile --norc -i

0 commit comments

Comments
 (0)