Skip to content

Commit 2b6ba94

Browse files
Askirclaude
andcommitted
fix(cli): make 0pflow alias the root command and always update plugin
The shell alias now points to `npx -y --prefer-online 0pflow@dev` (without `run`) so that `0pflow install`, `0pflow uninstall`, etc. all work. `0pflow run` now always reinstalls the plugin to keep it in sync. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 036b6f3 commit 2b6ba94

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

docs/plans/2026-02-17-install-flow-tasks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ curl -fsSL https://0pflow.com/install | bash
3030

3131
Create a shell alias so users can just type `0pflow run`:
3232
```bash
33-
alias 0pflow='npx -y --prefer-online 0pflow@dev run'
33+
alias 0pflow='npx -y --prefer-online 0pflow@dev'
3434
```
3535
Use `--prefer-online` to ensure npx always re-resolves the `@dev` tag and pulls the latest build. For production, switch to `@latest` once we have a stable release channel.
3636

@@ -133,7 +133,7 @@ The `npx` command shown to users after install doesn't suppress warnings. Change
133133

134134
### 13. ~~Consider global CLI install~~ — Decided against
135135

136-
We want "always fresh" — every invocation should pull the latest dev build. The bash script sets up a shell alias (`alias 0pflow='npx -y --prefer-online 0pflow@dev run'`) which handles this. A global install would require explicit `npm update -g` to get new versions.
136+
We want "always fresh" — every invocation should pull the latest dev build. The bash script sets up a shell alias (`alias 0pflow='npx -y --prefer-online 0pflow@dev'`) which handles this. A global install would require explicit `npm update -g` to get new versions.
137137

138138
## Implementation Order
139139

packages/core/src/cli/run.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,10 @@ export async function runRun(): Promise<void> {
217217
process.exit(1);
218218
}
219219

220-
// ── Auto-install plugin if needed ──────────────────────────────────
221-
if (!readSettings()) {
220+
// ── Always install/update plugin ────────────────────────────────────
221+
{
222222
const s = p.spinner();
223-
s.start("Installing 0pflow plugin for Claude Code...");
223+
s.start("Updating 0pflow plugin...");
224224
const mcpResult = buildMcpCommand();
225225
writeSettings({
226226
mcpCommand: mcpResult.command,
@@ -229,9 +229,9 @@ export async function runRun(): Promise<void> {
229229
addMarketplace(mcpResult, "ignore");
230230
const result = installPlugin("ignore");
231231
if (result.success) {
232-
s.stop(pc.green("Plugin installed"));
232+
s.stop(pc.green("Plugin up to date"));
233233
} else {
234-
s.stop(pc.yellow("Plugin install skipped (can retry with '0pflow install')"));
234+
s.stop(pc.yellow("Plugin update skipped (can retry with '0pflow install --force')"));
235235
}
236236
}
237237

scripts/install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ install_0pflow() {
168168
# ── Shell alias ──────────────────────────────────────────────────────────────
169169

170170
setup_alias() {
171-
local alias_line="alias 0pflow='npx -y --prefer-online 0pflow@dev run'"
171+
local alias_line="alias 0pflow='npx -y --prefer-online 0pflow@dev'"
172172
local alias_comment="# 0pflow CLI alias"
173173
local added_to=""
174174

@@ -239,7 +239,7 @@ main() {
239239
printf "\n"
240240
printf "${GREEN}${BOLD} Installation complete!${RESET}\n\n" >&2
241241
printf "${BOLD} To get started, run:${RESET}\n\n" >&2
242-
printf "${CYAN} source ${rc_file} && 0pflow${RESET}\n\n" >&2
242+
printf "${CYAN} source ${rc_file} && 0pflow run${RESET}\n\n" >&2
243243
}
244244

245245
main "$@"

0 commit comments

Comments
 (0)