@cryer/star-cli 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -8
- package/dist/main.js +808 -212
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
# Star CLI
|
|
2
2
|
|
|
3
|
+
[](https://github.com/cryer/star-cli/actions/workflows/ci.yml)
|
|
4
|
+
|
|
3
5
|
An AI agent command-line interface written in TypeScript — multi-model LLM access, streaming terminal UI, tool calling, permission control, and session persistence.
|
|
4
6
|
|
|
7
|
+
Features: streaming REPL with slash commands · OpenAI / Anthropic / OpenAI-compatible providers · built-in fs / bash / web tools with a permission gate · `@file` mentions · conversation compaction (`/compact`) · session persistence and resume (`/resume`, `star -r`) · file-write snapshots with `/undo` · persistent permission allow-rules · TODO task tracking · Markdown session export (`/export`).
|
|
8
|
+
|
|
5
9
|
## Requirements
|
|
6
10
|
|
|
7
11
|
- Node.js >= 20
|
|
@@ -20,10 +24,13 @@ star -p "hi" # non-interactive print mode
|
|
|
20
24
|
```bash
|
|
21
25
|
pnpm install
|
|
22
26
|
pnpm build
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
npm link # one-time: registers the `star` command globally
|
|
28
|
+
star # interactive REPL
|
|
29
|
+
star -p "hi" # non-interactive print mode
|
|
25
30
|
```
|
|
26
31
|
|
|
32
|
+
Without `npm link` you can run the bundle directly: `node dist/main.js` (re-run `pnpm build` after code changes; the linked `star` always points at `dist/`).
|
|
33
|
+
|
|
27
34
|
## Configuration
|
|
28
35
|
|
|
29
36
|
Config file: `~/.star-cli/config.toml` (project-level override: `.star/config.toml` in cwd; CLI flags win over both).
|
|
@@ -34,6 +41,10 @@ permissionMode = "ask" # auto | ask | readonly
|
|
|
34
41
|
contextMaxTokens = 100000
|
|
35
42
|
contextCompaction = "summary" # summary | truncate — how over-budget history is compacted
|
|
36
43
|
|
|
44
|
+
[permissions]
|
|
45
|
+
# persistent allow-rules, written automatically when you pick "a" (always) on a permission prompt
|
|
46
|
+
allow = ["bash(npm test)", "read_file"] # <tool> or <tool(<pattern>)>, * is a glob wildcard
|
|
47
|
+
|
|
37
48
|
[[providers]]
|
|
38
49
|
name = "openai"
|
|
39
50
|
protocol = "openai-compatible"
|
|
@@ -80,15 +91,30 @@ star -r <sessionId> resume a previous session
|
|
|
80
91
|
| `/todo` | show TODO list |
|
|
81
92
|
| `/cost` | show API token usage for this session |
|
|
82
93
|
| `/config` | show resolved config |
|
|
94
|
+
| `/compact` | compact conversation history to free up context |
|
|
95
|
+
| `/export [path]` | export the current session to a Markdown file |
|
|
96
|
+
| `/undo` | revert the last file write/edit made by a tool |
|
|
83
97
|
| `/clear` | clear the screen |
|
|
84
98
|
| `/exit` | quit |
|
|
85
99
|
| `/q` | quit (alias of `/exit`) |
|
|
86
100
|
|
|
87
|
-
Keys: `ESC` / `Ctrl+C` interrupts the current stream; on a permission prompt: `y` allow, `n` deny, `a` always allow
|
|
101
|
+
Keys: `ESC` / `Ctrl+C` interrupts the current stream; on a permission prompt: `y` allow, `n` deny, `a` always allow — the generated allow-rule (e.g. `bash(npm test)`) is saved to `permissions.allow` in the config file and survives restarts. Input editing: arrow keys move the cursor, `Ctrl+A`/`Ctrl+E` jump to start/end, `Ctrl+U`/`Ctrl+K` delete before/after the cursor, `Ctrl+W` deletes the previous word, up/down recall history. Typing `/` shows slash-command suggestions — `↑`/`↓` to highlight, `Tab` (or `→` at end of input) to complete, `ESC` to dismiss.
|
|
102
|
+
|
|
103
|
+
## @file mentions
|
|
104
|
+
|
|
105
|
+
Prefix a path with `@` in any prompt to attach its content (REPL and print mode alike):
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
star -p "summarize @README.md and @src/main.tsx"
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Missing, binary, oversized (>100KB), or sensitive files (`.env`, private keys) are skipped with a note. The chat history keeps your original `@path` text, so resumed sessions don't carry the injected bulk.
|
|
88
112
|
|
|
89
113
|
## Built-in tools
|
|
90
114
|
|
|
91
|
-
`read_file`, `write_file`, `edit_file`, `glob`, `grep`, `bash`, `web_fetch`, `todo_read`, `todo_write` — each declares a permission level (`read` / `write` / `exec`) enforced by the permission gate. Hard safety rules (dangerous shell commands, paths outside the working directory, secret files like `.env` / private keys) are denied in every mode.
|
|
115
|
+
`read_file`, `write_file`, `edit_file`, `glob`, `grep`, `bash`, `web_fetch`, `web_search` (DuckDuckGo, no API key needed), `todo_read`, `todo_write` — each declares a permission level (`read` / `write` / `exec`) enforced by the permission gate. Hard safety rules (dangerous shell commands, paths outside the working directory, secret files like `.env` / private keys) are denied in every mode and cannot be overridden by allow-rules.
|
|
116
|
+
|
|
117
|
+
Every successful `write_file` / `edit_file` first snapshots the file's previous content (in-memory, last 50 writes per session); `/undo` restores the most recent snapshot, deleting the file if it didn't exist before.
|
|
92
118
|
|
|
93
119
|
## Sessions
|
|
94
120
|
|
|
@@ -97,10 +123,13 @@ Sessions persist under `~/.star-cli/sessions/<id>/` (messages as JSONL + `meta.j
|
|
|
97
123
|
## Development
|
|
98
124
|
|
|
99
125
|
```bash
|
|
100
|
-
pnpm build
|
|
101
|
-
pnpm test
|
|
102
|
-
pnpm typecheck
|
|
103
|
-
pnpm lint
|
|
126
|
+
pnpm build # tsup bundle to dist/
|
|
127
|
+
pnpm test # vitest unit tests (no network)
|
|
128
|
+
pnpm typecheck # tsc --noEmit
|
|
129
|
+
pnpm lint # biome
|
|
130
|
+
pnpm test:pipeline # layered pipeline incl. optional live LLM smoke (needs an API key)
|
|
104
131
|
```
|
|
105
132
|
|
|
133
|
+
CI runs lint, typecheck, tests, and build on Ubuntu + Windows against Node 20/22 (`.github/workflows/ci.yml`).
|
|
134
|
+
|
|
106
135
|
Architecture: `src/cli` (Ink UI), `src/agent` (main loop), `src/llm` (Vercel AI SDK provider layer), `src/tools`, `src/context` (token budget + compaction), `src/permissions`, `src/session`, `src/config`.
|