deploro 0.2.0 → 0.2.1

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 (2) hide show
  1. package/dist/index.js +35 -2
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -499,6 +499,35 @@ async function useProjectCommand(idOrSlug) {
499
499
  writeConfig({ ...config, projectId: matches[0].id });
500
500
  console.log(`\u2713 Active project: ${matches[0].name} (${matches[0].slug})`);
501
501
  }
502
+ async function projectsDeleteCommand(idOrSlug, opts) {
503
+ const config = requireConfig();
504
+ const data = await apiRequestNoProject("/api/projects");
505
+ const q = idOrSlug.toLowerCase();
506
+ const matches = data.projects.filter(
507
+ (p) => p.id === idOrSlug || p.slug.toLowerCase() === q || p.name.toLowerCase() === q
508
+ );
509
+ if (matches.length === 0) {
510
+ console.error(`No project matches "${idOrSlug}". Run: deploro projects`);
511
+ process.exit(1);
512
+ }
513
+ if (matches.length > 1) {
514
+ console.error(
515
+ `"${idOrSlug}" is ambiguous (matches: ${matches.map((m) => m.slug).join(", ")}). Use the full id.`
516
+ );
517
+ process.exit(1);
518
+ }
519
+ const project = matches[0];
520
+ await confirmOrDie(
521
+ `Delete project "${project.name}" (${project.slug}) and its database? This cannot be undone.`,
522
+ opts.yes
523
+ );
524
+ await apiRequestNoProject(`/api/projects/${project.id}`, { method: "DELETE" });
525
+ console.log(`\u2713 Project "${project.name}" deleted`);
526
+ if (config.projectId === project.id) {
527
+ writeConfig({ ...config, projectId: void 0 });
528
+ console.log(" (cleared as active project)");
529
+ }
530
+ }
502
531
  async function deployCommand() {
503
532
  const config = requireProject();
504
533
  const data = await apiRequest(
@@ -561,12 +590,13 @@ async function deployLogsCommand(deploymentId) {
561
590
 
562
591
  // src/index.ts
563
592
  var program = new Command();
564
- program.name("deploro").description("Deploro developer platform CLI").version("0.2.0");
593
+ program.name("deploro").description("Deploro developer platform CLI").version("0.2.1");
565
594
  program.command("login").description("Log in to Deploro").option("--url <url>", "Worker base URL").option("--token <token>", "Personal access token from the Deploro dashboard").action(loginCommand);
566
595
  program.command("logout").description("Log out and clear local credentials").action(logoutCommand);
567
596
  program.command("projects").description("List projects").action(projectsListCommand);
568
597
  program.command("create <name>").description("Create a new project (and set it active)").option("--slug <slug>", "Project slug (derived from name if omitted)").option("--repo <url>", "GitHub repo URL to link for deployments").option("--branch <branch>", "Git branch to deploy from").action(projectsCreateCommand);
569
598
  program.command("use <project>").description("Set the active project (accepts id, slug, or name)").action(useProjectCommand);
599
+ program.command("delete <project>").description("Delete a project and its database (accepts id, slug, or name)").option("-y, --yes", "Skip confirmation prompt").action(projectsDeleteCommand);
570
600
  var db = program.command("db").description("Database commands");
571
601
  db.command("tables").description("List tables in the active project").action(dbTablesCommand);
572
602
  db.command("rows <table>").description("List rows in a table").option("--limit <n>", "Rows per page (max 200)", "20").option("--page <n>", "Page number", "1").option("--json", "Output raw JSON").action(dbRowsCommand);
@@ -588,4 +618,7 @@ var deploy = program.command("deploy").description("Deployment commands");
588
618
  deploy.command("trigger").description("Trigger a manual deployment").action(deployCommand);
589
619
  deploy.command("status").description("Show latest deployment status").action(deployStatusCommand);
590
620
  deploy.command("logs [deployment-id]").description("Show logs for a deployment (defaults to latest)").action(deployLogsCommand);
591
- program.parse();
621
+ program.parseAsync().catch((err) => {
622
+ console.error(`Error: ${err instanceof Error ? err.message : String(err)}`);
623
+ process.exit(1);
624
+ });
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "deploro",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Command-line interface for the Deploro developer platform — manage projects, databases, deployments, and hosting from your terminal.",
5
5
  "type": "module",
6
6
  "bin": {
7
- "deploro": "./dist/index.js"
7
+ "deploro": "dist/index.js"
8
8
  },
9
9
  "files": [
10
10
  "dist"