@biznetgio/neo-app 0.4.0 → 0.4.2

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.
package/README.md CHANGED
@@ -34,11 +34,10 @@ Fetch https://portal.app.neoapp.id/prompt.md and follow it to set this repo up o
34
34
  All mutating commands are idempotent, back up config before editing, and never write a
35
35
  token into agent/MCP configuration.
36
36
 
37
- ## Environments
37
+ ## Environment
38
38
 
39
- - **Production** (`https://portal.app.neoapp.id`) is the default.
40
- - **Staging** (`https://portal.neoapp.biznetgio.dev`) is selected by `--staging` or `NODE_ENV=development`.
41
- - `NEO_APP_URL` overrides the control-plane URL entirely (e.g. a local dev server).
39
+ The CLI talks to your NEO App control-plane — production by default. Set `NEO_APP_URL`
40
+ to point it at a different control-plane (e.g. a local dev server).
42
41
 
43
42
  ## Authentication
44
43
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@biznetgio/neo-app",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "NEO App CLI — one-command agent onboarding, MCP server, and project ops for coding agents (Codex, Claude Code).",
5
5
  "type": "module",
6
6
  "bin": {
package/prompt.md CHANGED
@@ -85,9 +85,8 @@ asked for a deployment.**
85
85
 
86
86
  ## Environment
87
87
 
88
- Staging is `https://portal.neoapp.biznetgio.dev`; production is
89
- `https://portal.app.neoapp.id`. Production is the default; `NODE_ENV=development` or
90
- `--staging` targets staging; `NEO_APP_URL` overrides the control-plane entirely.
88
+ The CLI targets production by default. Set `NEO_APP_URL` to point it at a different
89
+ control-plane when needed.
91
90
 
92
91
  ## Uninstall
93
92
 
@@ -2,6 +2,7 @@
2
2
  // InstaCloud's `insta project link`. Links the repo to a project (writes .neo-app.json)
3
3
  // after validating it against the authenticated account.
4
4
 
5
+ import { basename } from 'node:path';
5
6
  import { resolveConfig } from '../config.js';
6
7
  import { getCredential } from '../creds.js';
7
8
  import { NeoApi, ApiError } from '../api.js';
@@ -37,6 +38,37 @@ export async function link(projectId, opts = {}) {
37
38
  }
38
39
  }
39
40
 
41
+ // createProject makes a new project in the current org and links this repo to it
42
+ // (parity with `insta project create`). Name defaults to the working-directory name.
43
+ export async function createProject(name, opts = {}) {
44
+ const { cfg, api } = apiFor(opts);
45
+ const orgId = await api.resolveOrgId(opts.org);
46
+ const projName = String(name || opts.name || basename(process.cwd())).trim();
47
+ if (!projName) {
48
+ fail('usage: neo-app project create <name>');
49
+ process.exit(2);
50
+ }
51
+ let res;
52
+ try {
53
+ res = await api.post(`/api/v1/orgs/${orgId}/projects`, { name: projName });
54
+ } catch (e) {
55
+ fail(`could not create project '${projName}': ${e.message}`);
56
+ process.exit(1);
57
+ }
58
+ if (res.status === 202 && res.data?.status === 'pending_approval') {
59
+ ok(`create submitted — pending approval (${res.data.approvalId}). An owner/admin must approve.`);
60
+ return;
61
+ }
62
+ const proj = res.data?.project || res.data || {};
63
+ const environment = cfg.env === 'staging' ? 'staging' : 'production';
64
+ ok(`created project ${proj.name || projName}`);
65
+ if (proj.id) {
66
+ writeLink({ projectId: proj.id, environment, baseUrl: cfg.baseUrl, env: cfg.env, name: proj.name || projName });
67
+ ok(`linked ${proj.name || projName} / ${environment} ${c.dim('(.neo-app.json)')}`);
68
+ }
69
+ return proj;
70
+ }
71
+
40
72
  export async function listProjects(opts = {}) {
41
73
  const { api } = apiFor(opts);
42
74
  const orgId = await api.resolveOrgId(opts.org);
package/src/index.js CHANGED
@@ -28,6 +28,7 @@ ${c.bold('Commands')}
28
28
  login Authenticate with a NEO App API key (kap_...)
29
29
  link <project-id> Link this repo to a project (writes .neo-app.json)
30
30
  deploy Deploy a web service: --image <ref> or --repo <git-url>
31
+ project create [name] Create a project (defaults to the dir name) and link it
31
32
  project list List projects in your organization (find ids to link)
32
33
  status | whoami Show connected account, org, environment, linked project
33
34
  mcp Run the local stdio MCP server (used by agents)
@@ -39,17 +40,16 @@ ${c.bold('Options')}
39
40
  --name <name> Service name (deploy; default derived from the source)
40
41
  --port <n> Container port (deploy)
41
42
  --agent <codex|claude-code> Target one agent (config install-mcp)
42
- --staging | --prod Target staging (portal.neoapp.biznetgio.dev) or production (portal.app.neoapp.id)
43
43
  --url <url> Override the control-plane URL (also NEO_APP_URL)
44
44
  --token <kap_...> API key (also NEO_APP_TOKEN; prompted if omitted)
45
45
  --yes Non-interactive (headless/CI)
46
46
  --dry-run Print intended changes without writing
47
47
  -v, --version Print version
48
- -h, --help Show this help
48
+ -h, --help Show this help`;
49
49
 
50
- ${c.bold('Environment')}
51
- Production is the default. Set NODE_ENV=development (or pass --staging) for staging.
52
- NEO_APP_URL / NEO_APP_TOKEN override the target and credential.`;
50
+ // Internal: --staging / --prod / --env / NODE_ENV select the staging vs production
51
+ // control-plane (see src/config.js). Intentionally undocumented in --help — target
52
+ // selection is an internal/advanced concern; NEO_APP_URL is the public override.
53
53
 
54
54
  const options = {
55
55
  project: { type: 'string' },
@@ -101,6 +101,7 @@ export async function main(argv = process.argv.slice(2)) {
101
101
  if (cmd === 'deploy') return void (await (await import('./commands/deploy.js')).deploy(opts));
102
102
  if (cmd === 'link') return void (await (await import('./commands/link.js')).link(sub, opts));
103
103
  if (cmd === 'project' && sub === 'link') return void (await (await import('./commands/link.js')).link(positionals[2], opts));
104
+ if (cmd === 'project' && sub === 'create') return void (await (await import('./commands/link.js')).createProject(positionals[2], opts));
104
105
  if (cmd === 'project' && (sub === 'list' || sub === 'ls')) return void (await (await import('./commands/link.js')).listProjects(opts));
105
106
  if (cmd === 'status' || cmd === 'whoami') return void (await (await import('./commands/status.js')).status(opts));
106
107
  if (cmd === 'mcp') return void (await (await import('./mcp/server.js')).runMcpServer());
@@ -18,8 +18,7 @@ NEO App is Biznet Gio's managed-app platform. You operate it two ways:
18
18
 
19
19
  ## Environments: staging first
20
20
 
21
- - `portal.neoapp.biznetgio.dev` is **staging**; `portal.app.neoapp.id` is **production**.
22
- - Default to **staging** for every change. Deploy, test, and read logs on staging before touching production.
21
+ - Prefer **staging** for every change: deploy, test, and read logs on staging before touching production.
23
22
  - Only deploy to production when the user explicitly asks, and expect it to require approval (see below).
24
23
 
25
24
  ## Deployments