Skip to content

Commit 8fb09f0

Browse files
ralyodioclaude
andauthored
feat(tools): add the Turso CLI (#94)
Turso (libSQL/SQLite at the edge) joins the workflow tools, so `moshcode turso auth signup`, `moshcode turso auth login`, and every other subcommand pass straight through to the native CLI. Installs via the official script from https://github.com/tursodatabase/turso-cli, which unpacks to $HOME/.turso and appends that directory to the shell profile — so it is on PATH for the NEXT shell, and `moshcode tools` can still report turso as missing in the session that installed it. Re-running the installer fetches the latest, so there is no separate upgrade spec. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent b396d28 commit 8fb09f0

5 files changed

Lines changed: 26 additions & 3 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ moshcode install gh # GitHub release binary → ~/.local/bin
8484
moshcode install supabase # GitHub release binary (no global npm package exists)
8585
moshcode install doppler # official script, installed user-local (needs gpgv)
8686
moshcode install doctl # GitHub release binary → ~/.local/bin
87+
moshcode install turso # official script → ~/.turso (new shell to pick up PATH)
8788
moshcode install tailscale # official script; system daemon, so it needs root
8889

8990
moshcode gh pr list # straight through to the native CLI
@@ -252,6 +253,7 @@ chmod +x deploy.mosh
252253
| `supabase(args…)` | drive the Supabase CLI |
253254
| `doppler(args…)` | drive the Doppler CLI |
254255
| `doctl(args…)` | drive the DigitalOcean CLI |
256+
| `turso(args…)` | drive the Turso CLI |
255257
| `tailscale(args…)` | drive the Tailscale CLI |
256258
| `pwd()` | print the current repo/location |
257259
| `run(file)` | run another .mosh file (include/compose) |

src/commands.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ const COMMANDS = [
216216
cliVerb("supabase", "drive the Supabase CLI (local stack, migrations, functions)"),
217217
cliVerb("doppler", "drive the Doppler CLI (secrets, env injection)"),
218218
cliVerb("doctl", "drive the DigitalOcean CLI (droplets, apps, databases)"),
219+
cliVerb("turso", "drive the Turso CLI (auth, databases, replicas)"),
219220
cliVerb("tailscale", "drive the Tailscale CLI (mesh VPN: up, status, ssh, serve)"),
220221
cliVerb("pwd", "print the current repo/location"),
221222
];

src/tools.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,15 @@ export const TOOLS = {
8686
bin: "doctl",
8787
install: releaseInstall("doctl"),
8888
},
89+
turso: {
90+
desc: "Turso — libSQL/SQLite at the edge (auth signup/login, db, replicas)",
91+
bin: "turso",
92+
// https://github.com/tursodatabase/turso-cli — the official installer, which
93+
// unpacks to $HOME/.turso and appends that dir to your shell profile. It is
94+
// therefore on PATH for the NEXT shell, so `moshcode tools` can still show
95+
// turso as missing in the session that installed it.
96+
install: { cmd: "bash", args: ["-c", "curl -sSfL https://get.tur.so/install.sh | bash"] },
97+
},
8998
tailscale: {
9099
desc: "Tailscale — WireGuard mesh VPN (up, status, ssh, serve, funnel)",
91100
bin: "tailscale",

src/tui.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ function printHelp() {
154154
` ${acid("/coinpay [args…]")} hand off to the native CoinPay CLI`,
155155
` ${acid("/c0mpute [args…]")} hand off to the native c0mpute CLI`,
156156
` ${acid("/secrets [args…]")} share/view team secrets via logicsrc (login · teams · credentials)`,
157-
` ${acid("/railway")} ${acid("/gh")} ${acid("/supabase")} ${acid("/doppler")} ${acid("/doctl")} ${acid("/tailscale")}`,
157+
` ${acid("/railway")} ${acid("/gh")} ${acid("/supabase")} ${acid("/doppler")} ${acid("/doctl")} ${acid("/turso")} ${acid("/tailscale")}`,
158158
ash(" hand off to the native cloud CLIs (deploys · repos · db · secrets · infra · vpn)"),
159159
` ${acid("/mcp install <url>")} register an MCP server across every engine that supports it`,
160160
` ${acid("/skill install <url>")} install a skill across every engine that supports it`,
@@ -174,7 +174,7 @@ function printHelp() {
174174
ash(" local verbs: ") + acid("code() mosh() notify() ask() say() sleep() stop() repeat()"),
175175
ash(" CLI verbs: ") + acid("agents() start() install() upgrade() mcp() skill() prd()"),
176176
ash(" ") + acid("ugig() coinpay() c0mpute() secrets() pwd() run() shell()"),
177-
ash(" ") + acid("railway() gh() supabase() doppler() doctl() tailscale()"),
177+
ash(" ") + acid("railway() gh() supabase() doppler() doctl() turso() tailscale()"),
178178
ash(" shebang: ") + acid("#!/usr/bin/env moshscript") + ash(" (chmod +x to self-run)"),
179179
"",
180180
ash(" raw shortcuts: type an engine or tool name by itself, e.g. ") + acid("claude") + ash(" or ") + acid("ugig"),

test/tools.test.mjs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ test("tool registry uses the official native CLI packages", () => {
9797
});
9898

9999
test("cloud CLIs resolve and are listed as workflow tools", () => {
100-
for (const key of ["railway", "gh", "supabase", "doppler", "doctl", "tailscale"]) {
100+
for (const key of ["railway", "gh", "supabase", "doppler", "doctl", "turso", "tailscale"]) {
101101
assert.deepEqual(resolveTool(key), [key, TOOLS[key]]);
102102
assert.equal(TOOLS[key].bin, key);
103103
assert.match(toolList(), new RegExp(key));
@@ -126,6 +126,17 @@ test("doppler installs user-local and updates natively", () => {
126126
assert.deepEqual(TOOLS.doppler.upgrade, { cmd: "doppler", args: ["update"] });
127127
});
128128

129+
test("turso installs from its official script", () => {
130+
// https://github.com/tursodatabase/turso-cli — unpacks to $HOME/.turso and
131+
// appends it to the shell profile, so it lands on PATH for the next shell.
132+
assert.deepEqual(TOOLS.turso.install, {
133+
cmd: "bash",
134+
args: ["-c", "curl -sSfL https://get.tur.so/install.sh | bash"],
135+
});
136+
// Re-running the installer fetches the latest, so no separate upgrade spec.
137+
assert.equal(TOOLS.turso.upgrade, undefined);
138+
});
139+
129140
test("tailscale uses the official installer and native updater", () => {
130141
// tailscale is a system daemon, so unlike gh/supabase/doctl it goes through
131142
// the vendor script + package manager rather than a user-local binary drop.

0 commit comments

Comments
 (0)