@oodarun/cli 0.1.15 → 0.1.17

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.
Files changed (3) hide show
  1. package/README.md +5 -4
  2. package/dist/cli.js +34 -7
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -78,15 +78,16 @@ Publish a built static site to a permanent shareable URL at `{slug}-p.ooda.run`.
78
78
  From the CLI — fully non-interactive, so agents and CI can drive it:
79
79
 
80
80
  ```bash
81
- ooda publish ./dist # publish a built site
82
- ooda publish ./dist --slug my-app # choose the slug
81
+ ooda publish # run in the project root (auto-detects the build dir)
82
+ ooda publish --slug my-app # choose the slug
83
83
  ooda sites list # list published sites
84
84
  ooda sites access my-app --mode password --password s3cret # gate access
85
85
  ooda sites delete my-app # unpublish
86
86
  ```
87
87
 
88
- `publish` uploads an already-built output directory (it looks for `dist`,
89
- `build`, `out`, `.output/public`, or `.next/static`) run your build first.
88
+ Run `publish` from your **project root** it auto-detects the build output
89
+ (`dist`, `build`, `out`, `.output/public`, or `.next/static`) inside it. Don't
90
+ pass the build folder itself (`ooda publish ./dist` is wrong). Build first.
90
91
  Add `--json` to any command for machine-readable output, and set
91
92
  `OODA_ACCESS_TOKEN` + `OODA_ORG_ID` to run without an interactive login.
92
93
 
package/dist/cli.js CHANGED
@@ -1168,7 +1168,12 @@ async function handleEmailPasswordAuth() {
1168
1168
  return passwordLoginInteractive();
1169
1169
  }
1170
1170
  async function emailCodeLoginInteractive(prefillEmail) {
1171
- const email = prefillEmail || await prompt(` ${c.blue}${c.bold}Email:${c.reset} `);
1171
+ const remembered = getOrgEmail();
1172
+ let email = prefillEmail;
1173
+ if (!email) {
1174
+ const label = remembered ? ` ${c.blue}${c.bold}Email${c.reset} ${c.gray}(${remembered}):${c.reset} ` : ` ${c.blue}${c.bold}Email:${c.reset} `;
1175
+ email = await prompt(label) || remembered || "";
1176
+ }
1172
1177
  if (!email) process.exit(1);
1173
1178
  if (!await requestLoginCode(email)) {
1174
1179
  console.log(` ${c.red}Couldn't send a login code. Check the email address and try again.${c.reset}`);
@@ -1325,6 +1330,21 @@ function whoamiCmd(opts) {
1325
1330
  `);
1326
1331
  }
1327
1332
  }
1333
+ function logoutCmd(opts) {
1334
+ const envSession = Boolean(process.env.OODA_ACCESS_TOKEN || process.env.OODA_ORG_ID);
1335
+ clearJwtTokens();
1336
+ clearOrgMode();
1337
+ if (opts.json) {
1338
+ console.log(JSON.stringify({ ok: true, loggedOut: true, envSession }));
1339
+ return;
1340
+ }
1341
+ console.log(`
1342
+ ${c.green}${c.bold}\u2713${c.reset} Logged out${c.gray} (cleared ~/.ooda/auth.json).${c.reset}`);
1343
+ if (envSession) {
1344
+ console.log(` ${c.yellow}!${c.reset} ${c.gray}A session is still set via ${c.bold}OODA_ACCESS_TOKEN${c.reset}${c.gray}/${c.bold}OODA_ORG_ID${c.reset}${c.gray} \u2014 unset those to fully log out.${c.reset}`);
1345
+ }
1346
+ console.log("");
1347
+ }
1328
1348
  async function completeJwtLogin(result) {
1329
1349
  let orgId;
1330
1350
  let orgName;
@@ -5904,6 +5924,7 @@ Usage:
5904
5924
  Commands:
5905
5925
  (no command) Open the interactive project menu
5906
5926
  login Sign in with an email code (password fallback)
5927
+ logout Sign out (clears the saved session)
5907
5928
  whoami Show the current session (exits non-zero if none)
5908
5929
  list, ls List your projects
5909
5930
  connect <project> Connect to a project and run Claude (interactive)
@@ -5924,9 +5945,10 @@ login
5924
5945
  --json Machine-readable JSON output
5925
5946
 
5926
5947
  publish [path]
5927
- Publishes an already-built static site (no build is run). Looks for a build
5928
- output dir (dist, build, out, .output/public, .next/static) in [path] (default:
5929
- current dir). Requires an org login.
5948
+ Publishes an already-built static site (no build is run). Run it from your
5949
+ project ROOT \u2014 [path] is the project directory (default: current dir), NOT the
5950
+ build folder. The CLI finds the build output inside it (dist, build, out,
5951
+ .output/public, .next/static). Requires an org login.
5930
5952
  --slug <slug> Override the slug (default: ooda.json name, else folder name)
5931
5953
  --json Machine-readable JSON output
5932
5954
 
@@ -5952,14 +5974,14 @@ Local dev:
5952
5974
  stack instead of production.
5953
5975
 
5954
5976
  Examples:
5955
- ooda publish ./dist --slug my-app
5977
+ ooda publish --slug my-app # run from the project root (auto-detects the build dir)
5956
5978
  ooda sites list --json
5957
5979
  ooda sites access my-app --mode password --password hunter2
5958
5980
  ooda sites delete my-app --json`;
5959
5981
  }
5960
5982
 
5961
5983
  // src/cli/index.ts
5962
- var CLI_VERSION = "0.1.15";
5984
+ var CLI_VERSION = "0.1.17";
5963
5985
  function formatMutationError(result) {
5964
5986
  const parts = [];
5965
5987
  if (result.status !== void 0) parts.push(String(result.status));
@@ -6006,6 +6028,7 @@ function parseArgs(argv) {
6006
6028
  else if (first === "publish") command = "publish";
6007
6029
  else if (first === "sites") command = "sites";
6008
6030
  else if (first === "login") command = "login";
6031
+ else if (first === "logout") command = "logout";
6009
6032
  else if (first === "whoami") command = "whoami";
6010
6033
  else if (first === "help") command = "help";
6011
6034
  if (rest.includes("--help") || rest.includes("-h")) command = "help";
@@ -6486,7 +6509,6 @@ async function directConnect(projectName) {
6486
6509
  async function main() {
6487
6510
  const args = parseArgs(process.argv);
6488
6511
  const cwd = process.cwd();
6489
- printLogo(CLI_VERSION);
6490
6512
  if (args.command === "help") {
6491
6513
  console.log(buildHelpText(CLI_VERSION));
6492
6514
  process.exit(0);
@@ -6525,6 +6547,10 @@ async function main() {
6525
6547
  whoamiCmd({ json: args.json });
6526
6548
  process.exit(process.exitCode ?? 0);
6527
6549
  }
6550
+ if (args.command === "logout") {
6551
+ logoutCmd({ json: args.json });
6552
+ process.exit(process.exitCode ?? 0);
6553
+ }
6528
6554
  if (args.command === "connect") {
6529
6555
  if (!args.connectTarget) {
6530
6556
  console.log(` ${c.red}Usage: ooda connect <project-name>${c.reset}`);
@@ -6536,6 +6562,7 @@ async function main() {
6536
6562
  await directConnect(args.connectTarget);
6537
6563
  process.exit(0);
6538
6564
  }
6565
+ printLogo(CLI_VERSION);
6539
6566
  const { port } = await startServer({ port: args.port, cwd });
6540
6567
  const dashboardUrl = process.env.OODA_DASHBOARD_BASE || `http://localhost:${port}`;
6541
6568
  while (true) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oodarun/cli",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "description": "Launch Claude Code on cloud dev environments",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",