Skip to content

Commit 740d91d

Browse files
feat(setup): 'bun run sim' is the primary entry; bare invocation prints help
- Lead usage/wizard-outro/README with 'bun run sim <cmd>' (works with zero PATH setup); global bare 'sim' via bun link is an optional upgrade, with the ~/.bun/bin PATH caveat spelled out (Homebrew's bun omits it). - Bare 'sim' now prints help instead of launching the wizard; the wizard is 'sim setup'. The 'setup' npm script passes the keyword so 'bun run setup' is unchanged.
1 parent f24f237 commit 740d91d

4 files changed

Lines changed: 40 additions & 34 deletions

File tree

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,19 +91,21 @@ bun run setup
9191

9292
When it finishes, open [http://localhost:3000](http://localhost:3000).
9393

94-
Manage your install with the `sim` CLI — run `bun link` once so `sim` works anywhere (or prefix `bun run`):
94+
Manage your install with `bun run sim`:
9595

9696
```bash
97-
sim start | stop | restart # bring your install up / down / cycle
98-
sim status # what's installed and healthy
99-
sim logs # follow logs
100-
sim doctor # diagnose configuration problems
101-
sim down # remove containers (data kept)
102-
sim reset # archive .env and wipe managed data
97+
bun run sim start | stop | restart # bring your install up / down / cycle
98+
bun run sim status # what's installed and healthy
99+
bun run sim logs # follow logs
100+
bun run sim doctor # diagnose configuration problems
101+
bun run sim down # remove containers (data kept)
102+
bun run sim reset # archive .env and wipe managed data
103103
```
104104

105105
`sim` detects how you're running (Docker Compose, local dev, or Kubernetes) and acts accordingly.
106106

107+
Prefer a bare `sim`? Run `bun link` once — but note `sim` lands in `~/.bun/bin`, which Homebrew's bun doesn't add to your PATH, so you may need `export PATH="$HOME/.bun/bin:$PATH"` in your shell profile.
108+
107109
Sim also supports local models via [Ollama](https://ollama.ai) and [vLLM](https://docs.vllm.ai/). See the [self-hosting docs](https://docs.sim.ai/self-hosting/docker) for details.
108110

109111
## Chat API Keys

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"mship:check": "bun run scripts/generate-mship-contracts.ts --check",
6060
"skills:sync": "bun run scripts/sync-skills.ts",
6161
"skills:check": "bun run scripts/sync-skills.ts --check",
62-
"setup": "bun run scripts/setup/index.ts",
62+
"setup": "bun run scripts/setup/index.ts setup",
6363
"sim": "bun run scripts/setup/index.ts",
6464
"doctor": "bun run scripts/setup/index.ts doctor",
6565
"agent-stream-docs:generate": "bun run scripts/sync-agent-stream-docs.ts",

scripts/setup/index.ts

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ import { theme } from './theme.ts'
88
import { runWizard, type WizardMode } from './wizard.ts'
99

1010
const USAGE = `Usage:
11-
sim run the setup wizard
12-
sim setup [--quick] [--mode compose|dev|k8s]
13-
sim doctor [--fix] [--json] check your setup
14-
sim start | stop | restart bring your install up / down / cycle
15-
sim status what's installed and healthy
16-
sim logs follow logs
17-
sim down remove containers (data kept)
18-
sim reset archive .env + wipe managed data
11+
bun run setup run the setup wizard
12+
bun run sim setup [--quick] [--mode compose|dev|k8s]
13+
bun run sim doctor [--fix] [--json] check your setup
14+
bun run sim start | stop | restart bring your install up / down / cycle
15+
bun run sim status what's installed and healthy
16+
bun run sim logs follow logs
17+
bun run sim down remove containers (data kept)
18+
bun run sim reset archive .env + wipe managed data
1919
20-
Not linked yet? Prefix with "bun run" (e.g. bun run sim status), or run
21-
"bun link" once so "sim" works anywhere.`
20+
Prefer a bare "sim"? Run "bun link" once, then ensure ~/.bun/bin is on your
21+
PATH (Homebrew's bun doesn't add it): export PATH="$HOME/.bun/bin:$PATH".`
2222

2323
function parseMode(value: string | undefined): WizardMode {
2424
if (value === 'compose' || value === 'dev' || value === 'k8s') return value
@@ -35,6 +35,12 @@ async function main(): Promise<void> {
3535

3636
const command = args[0]
3737

38+
// Bare `sim` prints help; the wizard is `sim setup` (or `bun run setup`).
39+
if (!command) {
40+
console.log(USAGE)
41+
return
42+
}
43+
3844
if (command === 'doctor') {
3945
process.exitCode = await runDoctor({
4046
fix: args.includes('--fix'),
@@ -43,26 +49,24 @@ async function main(): Promise<void> {
4349
return
4450
}
4551

46-
if (command && isLifecycleCommand(command)) {
52+
if (isLifecycleCommand(command)) {
4753
await runLifecycle(command)
4854
return
4955
}
5056

51-
// Anything else that looks like a command (not a flag, not `setup`) is a typo.
52-
if (command && !command.startsWith('-') && command !== 'setup') {
53-
console.error(`Unknown command: ${command}\n`)
54-
console.log(USAGE)
55-
process.exitCode = 1
57+
if (command === 'setup') {
58+
const setupArgs = args.slice(1)
59+
const modeIdx = setupArgs.indexOf('--mode')
60+
await runWizard({
61+
quick: setupArgs.includes('--quick'),
62+
mode: modeIdx === -1 ? undefined : parseMode(setupArgs[modeIdx + 1]),
63+
})
5664
return
5765
}
5866

59-
// Bare invocation and `setup` both run the wizard; strip the optional keyword.
60-
const setupArgs = command === 'setup' ? args.slice(1) : args
61-
const modeIdx = setupArgs.indexOf('--mode')
62-
await runWizard({
63-
quick: setupArgs.includes('--quick'),
64-
mode: modeIdx === -1 ? undefined : parseMode(setupArgs[modeIdx + 1]),
65-
})
67+
console.error(`Unknown command: ${command}\n`)
68+
console.log(USAGE)
69+
process.exitCode = 1
6670
}
6771

6872
function renderFailure(error: unknown): void {

scripts/setup/wizard.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,10 @@ export async function runWizard(flags: WizardFlags): Promise<void> {
162162
p.note(
163163
[
164164
mode === 'k8s' ? `port-forward, then open ${url}` : `open ${url}`,
165-
'manage it: sim start · sim stop · sim status · sim logs',
166-
'check your setup: sim doctor',
165+
'manage it: bun run sim start · stop · status · logs',
166+
'check your setup: bun run sim doctor',
167167
mode === 'dev' && !startDevNow ? `start Sim: bun run ${devScript}` : null,
168-
`run "sim" anywhere: ${theme.command('bun link')} once (otherwise ${theme.command('bun run sim <cmd>')})`,
168+
`prefer a bare "sim"? ${theme.command('bun link')} once (needs ~/.bun/bin on PATH)`,
169169
]
170170
.filter(Boolean)
171171
.join('\n'),

0 commit comments

Comments
 (0)