Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,6 @@ jobs:
- name: Run TypeScript unit tests
run: bun run test

- name: Check remaining shell syntax
run: bash -n completions/rootcell.bash

- name: Install ShellCheck
run: |
sudo apt-get update
sudo apt-get install -y shellcheck

- name: Run ShellCheck
run: shellcheck --severity=warning completions/rootcell.bash

- name: Compile Python modules
run: python3 -m compileall proxy

Expand Down
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,6 @@ proxy/ allowlists and mitmproxy/dnsmasq firewall code
agent_spy.py Bedrock Runtime formatter for `./rootcell spy`
agent_spy_tui.py Textual browser for `./rootcell spy --tui`
pi/agent/ global pi instructions, skills, and extensions
completions/ bash and zsh completion for `rootcell`
```

## VM Lifecycle
Expand Down Expand Up @@ -423,11 +422,9 @@ Do not put provider keys in `home.nix`; the Nix store is world-readable.

### Shell Completions

`rootcell completion` prints the yargs-generated completion script. The checked-in
files under `completions/` are generated from that command; refresh them with
`bun run completions` after changing commands or options. The generated scripts
register `rootcell`, so put `rootcell` on `PATH` before sourcing or installing
them.
`rootcell completion` prints the yargs-generated completion script. Generate it
from the installed `rootcell` command so completions stay in sync with the
version on `PATH`.

For zsh, after `compinit`:

Expand Down
29 changes: 0 additions & 29 deletions completions/rootcell.bash

This file was deleted.

27 changes: 0 additions & 27 deletions completions/rootcell.zsh

This file was deleted.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"private": true,
"type": "module",
"scripts": {
"completions": "SHELL=/bin/bash ./rootcell completion | sed '${/^$/d;}' > completions/rootcell.bash && SHELL=/bin/zsh ./rootcell completion | sed '${/^$/d;}' > completions/rootcell.zsh",
"typecheck": "tsc --noEmit",
"lint": "eslint \"src/**/*.{ts,js,mjs,cjs}\" eslint.config.ts vitest.config.ts",
"test": "vitest --project unit --run",
Expand Down
2 changes: 1 addition & 1 deletion src/rootcell/integration/common/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const defaultSpyOptions = {
export function findRepoDir(importMetaUrl: string): string {
let dir = dirname(resolve(fileURLToPath(importMetaUrl)));
for (;;) {
if (existsSync(resolve(dir, "flake.nix")) && existsSync(resolve(dir, "completions"))) {
if (existsSync(resolve(dir, "flake.nix")) && existsSync(resolve(dir, "src/rootcell"))) {
return dir;
}
const parent = dirname(dir);
Expand Down
10 changes: 5 additions & 5 deletions src/rootcell/rootcell.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1131,14 +1131,14 @@ describe("reload helper", () => {
});
});

describe("completion files", () => {
describe("shell completions", () => {
test("bash and zsh completions are generated by yargs", () => {
const bash = readFileSync("completions/rootcell.bash", "utf8");
const zsh = readFileSync("completions/rootcell.zsh", "utf8");
expect(bash).toBe(generatedCompletion("/bin/bash"));
expect(zsh).toBe(generatedCompletion("/bin/zsh"));
const bash = generatedCompletion("/bin/bash");
const zsh = generatedCompletion("/bin/zsh");
expect(bash).toContain("yargs command completion script");
expect(zsh).toContain("yargs command completion script");
expect(bash).toContain("complete -o bashdefault -o default -F _rootcell_yargs_completions rootcell");
expect(zsh).toContain("compdef _rootcell_yargs_completions rootcell");
});

test("yargs completion API includes all typed subcommands", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/rootcell/rootcell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function shellQuote(value: string): string {
function repoDirFromImportMeta(importMetaPath: string): string {
let dir = dirname(resolve(importMetaPath));
for (;;) {
if (existsSync(join(dir, "flake.nix")) && existsSync(join(dir, "completions"))) {
if (existsSync(join(dir, "flake.nix")) && existsSync(join(dir, "src/rootcell"))) {
return dir;
}
const parent = dirname(dir);
Expand Down