ardent-cli-beta 0.0.11 → 0.0.12

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
@@ -4,11 +4,15 @@
4
4
 
5
5
  The Ardent CLI is the customer command-line client for the control-plane API.
6
6
 
7
- The Oclif foundation and authentication are implemented. `ardent login` opens
7
+ Install the beta with `npm install --global ardent-cli-beta`, then run
8
+ `ardent-beta <command>`. The package registers only the `ardent-beta` executable,
9
+ so it can be installed alongside an existing `ardent` command.
10
+
11
+ The Oclif foundation and authentication are implemented. `ardent-beta login` opens
8
12
  the Ardent frontend and returns the approved API key through a loopback callback
9
- bound with PKCE. `ardent login --token <token>` validates and stores an existing
13
+ bound with PKCE. `ardent-beta login --token <token>` validates and stores an existing
10
14
  API token for CI and automation; `ARDENT_TOKEN` supplies the same flag
11
- non-interactively. `ardent status` and `ardent logout` inspect and remove that
15
+ non-interactively. `ardent-beta status` and `ardent-beta logout` inspect and remove that
12
16
  local session. The CLI always talks to Ardent's production control plane. Oclif
13
17
  provides help, version, autocomplete, and native JSON command behavior. Resource
14
18
  context is retained from login. Project listing, creation, deletion, and local
@@ -73,7 +73,7 @@ export async function loginWithBrowser(directory, options = {}) {
73
73
  options.onAuthorizationURL?.(authorizationURL.toString(), opened);
74
74
  const timeout = setTimeout(() => {
75
75
  deadline.abort();
76
- rejectLogin(new Error('Ardent CLI login timed out. Run ardent login to try again.'));
76
+ rejectLogin(new Error('Ardent CLI login timed out. Run ardent-beta login to try again.'));
77
77
  }, options.timeoutMs ?? LOGIN_TIMEOUT_MS);
78
78
  try {
79
79
  return await completion;
@@ -55,7 +55,7 @@ export async function loadSession(directory) {
55
55
  };
56
56
  }
57
57
  catch {
58
- throw new Error(`Ardent configuration at ${configPath(directory)} is invalid. Run ardent logout, then log in again.`);
58
+ throw new Error(`Ardent configuration at ${configPath(directory)} is invalid. Run ardent-beta logout, then log in again.`);
59
59
  }
60
60
  }
61
61
  function isProjectIdentity(value) {
@@ -22,9 +22,9 @@ export default class ConnectorCreate extends ArdentCommand {
22
22
  }
23
23
  const session = await loadSession(this.config.configDir);
24
24
  if (!session?.organization)
25
- this.error('You must be logged in to run this command. Run ardent login.');
25
+ this.error('You must be logged in to run this command. Run ardent-beta login.');
26
26
  if (!session.selectedProject)
27
- this.error('No project selected. Run ardent project list, then ardent project switch <name>.');
27
+ this.error('No project selected. Run ardent-beta project list, then ardent-beta project switch <name>.');
28
28
  const providedName = flags.name?.trim();
29
29
  if (flags.name !== undefined && !providedName)
30
30
  this.error('Connector name cannot be empty.');
@@ -8,9 +8,9 @@ export default class ConnectorList extends ArdentCommand {
8
8
  async run() {
9
9
  const session = await loadSession(this.config.configDir);
10
10
  if (!session?.organization)
11
- this.error('You must be logged in to run this command. Run ardent login.');
11
+ this.error('You must be logged in to run this command. Run ardent-beta login.');
12
12
  if (!session.selectedProject)
13
- this.error('No project selected. Run ardent project list, then ardent project switch <name>.');
13
+ this.error('No project selected. Run ardent-beta project list, then ardent-beta project switch <name>.');
14
14
  const connectors = await listConnectors(session.token, session.organization.id, session.selectedProject.id);
15
15
  if (!this.jsonEnabled()) {
16
16
  if (connectors.length === 0)
@@ -16,7 +16,7 @@ export default class MemberDelete extends ArdentCommand {
16
16
  this.error('Email cannot be empty.');
17
17
  const session = await loadSession(this.config.configDir);
18
18
  if (!session?.organization)
19
- this.error('You must be logged in to run this command. Run ardent login.');
19
+ this.error('You must be logged in to run this command. Run ardent-beta login.');
20
20
  const [memberships, invitations] = await Promise.all([
21
21
  listMemberships(session.token, session.organization.id),
22
22
  listInvitations(session.token, session.organization.id),
@@ -25,7 +25,7 @@ export default class MemberInvite extends ArdentCommand {
25
25
  this.error('Email cannot be empty.');
26
26
  const session = await loadSession(this.config.configDir);
27
27
  if (!session?.organization)
28
- this.error('You must be logged in to run this command. Run ardent login.');
28
+ this.error('You must be logged in to run this command. Run ardent-beta login.');
29
29
  const role = roles[flags.role];
30
30
  const invitation = await inviteMember(session.token, session.organization.id, email, role);
31
31
  if (!this.jsonEnabled())
@@ -8,7 +8,7 @@ export default class MemberList extends ArdentCommand {
8
8
  async run() {
9
9
  const session = await loadSession(this.config.configDir);
10
10
  if (!session?.organization)
11
- this.error('You must be logged in to run this command. Run ardent login.');
11
+ this.error('You must be logged in to run this command. Run ardent-beta login.');
12
12
  const [memberships, invitations] = await Promise.all([
13
13
  listMemberships(session.token, session.organization.id),
14
14
  listReadableInvitations(session.token, session.organization.id),
@@ -17,9 +17,9 @@ export default class ProjectCreate extends ArdentCommand {
17
17
  this.error('Project name cannot be empty.');
18
18
  const session = await loadSession(this.config.configDir);
19
19
  if (!session)
20
- this.error('Not logged in to Ardent. Run ardent login.');
20
+ this.error('Not logged in to Ardent. Run ardent-beta login.');
21
21
  if (!session.organization)
22
- this.error('You must be logged in to run this command. Run ardent login.');
22
+ this.error('You must be logged in to run this command. Run ardent-beta login.');
23
23
  const project = await createProject(session.token, session.organization.id, name);
24
24
  await selectProject(this.config.configDir, session, project);
25
25
  if (!this.jsonEnabled())
@@ -17,7 +17,7 @@ export default class ProjectDelete extends ArdentCommand {
17
17
  this.error('Project name cannot be empty.');
18
18
  const session = await loadSession(this.config.configDir);
19
19
  if (!session?.organization)
20
- this.error('You must be logged in to run this command. Run ardent login.');
20
+ this.error('You must be logged in to run this command. Run ardent-beta login.');
21
21
  const projects = await listProjects(session.token, session.organization.id);
22
22
  const project = projects.find((candidate) => candidate.name === name);
23
23
  if (!project)
@@ -10,9 +10,9 @@ export default class ProjectList extends ArdentCommand {
10
10
  async run() {
11
11
  const session = await loadSession(this.config.configDir);
12
12
  if (!session)
13
- this.error('Not logged in to Ardent. Run ardent login.');
13
+ this.error('Not logged in to Ardent. Run ardent-beta login.');
14
14
  if (!session.organization)
15
- this.error('You must be logged in to run this command. Run ardent login.');
15
+ this.error('You must be logged in to run this command. Run ardent-beta login.');
16
16
  const projects = await listProjects(session.token, session.organization.id);
17
17
  const refreshedSession = await replaceProjectCache(this.config.configDir, session, projects);
18
18
  if (!this.jsonEnabled()) {
@@ -16,10 +16,10 @@ export default class ProjectSwitch extends ArdentCommand {
16
16
  this.error('Project name cannot be empty.');
17
17
  const session = await loadSession(this.config.configDir);
18
18
  if (!session?.organization)
19
- this.error('You must be logged in to run this command. Run ardent login.');
19
+ this.error('You must be logged in to run this command. Run ardent-beta login.');
20
20
  const project = cachedProjectNamed(session, name);
21
21
  if (!project)
22
- this.error(`Project ${JSON.stringify(name)} not found. Run ardent project list.`);
22
+ this.error(`Project ${JSON.stringify(name)} not found. Run ardent-beta project list.`);
23
23
  await selectProject(this.config.configDir, session, project);
24
24
  if (!this.jsonEnabled())
25
25
  this.log(`✓ Switched to project ${terminalText(project.name)}`);
package/dist/help.js CHANGED
@@ -13,12 +13,12 @@ export default class ArdentHelp extends Help {
13
13
  }
14
14
  this.log('Get started:');
15
15
  this.log('');
16
- this.log(ux.colorize('green', ' ardent login Standard CLI login'));
17
- this.log(' ardent login --token <token> Non-interactive login (CI and automation)');
16
+ this.log(ux.colorize('green', ' ardent-beta login Standard CLI login'));
17
+ this.log(' ardent-beta login --token <token> Non-interactive login (CI and automation)');
18
18
  this.log('');
19
19
  this.log('For all commands:');
20
20
  this.log('');
21
- this.log(' ardent --help');
21
+ this.log(' ardent-beta --help');
22
22
  }
23
23
  async authenticated() {
24
24
  try {
@@ -31,7 +31,7 @@ export default class ArdentHelp extends Help {
31
31
  showArdentHelp(authenticated) {
32
32
  this.log(`Ardent CLI ${ux.colorize('dim', `v${this.config.version}`)}`);
33
33
  this.log('');
34
- this.log(this.section('USAGE', '$ ardent <command>'));
34
+ this.log(this.section('USAGE', '$ ardent-beta <command>'));
35
35
  const groups = new Map();
36
36
  for (const command of this.sortedCommands) {
37
37
  if (command.hidden || command.pluginName !== this.config.name || typeof command.helpGroup !== 'string')
@@ -42,7 +42,7 @@ export default class ArdentHelp extends Help {
42
42
  }
43
43
  for (const [group, commands] of groups) {
44
44
  const rows = commands.map((command) => {
45
- const name = `ardent ${command.id.replaceAll(':', ' ')}`;
45
+ const name = `ardent-beta ${command.id.replaceAll(':', ' ')}`;
46
46
  return [!authenticated && command.id === 'login' ? ux.colorize('green', name) : name, this.summary(command)];
47
47
  });
48
48
  this.log('');
@@ -72,12 +72,12 @@ export async function inviteMember(token, organizationID, email, role) {
72
72
  export async function deleteMembership(token, organizationID, userID) {
73
73
  const response = await request(token, `/organizations/${encodeURIComponent(organizationID)}/memberships/${encodeURIComponent(userID)}`, { method: 'DELETE' });
74
74
  if (response !== undefined)
75
- throw new Error('Ardent API did not confirm member deletion. Run ardent member list before retrying.');
75
+ throw new Error('Ardent API did not confirm member deletion. Run ardent-beta member list before retrying.');
76
76
  }
77
77
  export async function deleteInvitation(token, organizationID, invitationID) {
78
78
  const response = await request(token, `/organizations/${encodeURIComponent(organizationID)}/invitations/${encodeURIComponent(invitationID)}`, { method: 'DELETE' });
79
79
  if (response !== undefined)
80
- throw new Error('Ardent API did not confirm invitation cancellation. Run ardent member list before retrying.');
80
+ throw new Error('Ardent API did not confirm invitation cancellation. Run ardent-beta member list before retrying.');
81
81
  }
82
82
  function isMembership(value, organizationID) {
83
83
  if (typeof value !== 'object' || value === null)
@@ -20,7 +20,7 @@ export async function createProject(token, organizationID, name) {
20
20
  export async function deleteProject(token, organizationID, projectID) {
21
21
  const response = await request(token, `/projects/${encodeURIComponent(projectID)}?organization_id=${encodeURIComponent(organizationID)}`, { method: 'DELETE' });
22
22
  if (response !== undefined) {
23
- throw new Error('Ardent API did not confirm project deletion. Run ardent project list before retrying.');
23
+ throw new Error('Ardent API did not confirm project deletion. Run ardent-beta project list before retrying.');
24
24
  }
25
25
  }
26
26
  function isProject(value, organizationID) {
@@ -436,5 +436,5 @@
436
436
  ]
437
437
  }
438
438
  },
439
- "version": "0.0.11"
439
+ "version": "0.0.12"
440
440
  }
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "ardent-cli-beta",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "description": "The Ardent command-line interface",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "bin": {
8
- "ardent": "./bin/run.js"
8
+ "ardent-beta": "./bin/run.js"
9
9
  },
10
10
  "main": "./dist/index.js",
11
11
  "types": "./dist/index.d.ts",
@@ -22,7 +22,7 @@
22
22
  "registry": "https://registry.npmjs.org/"
23
23
  },
24
24
  "oclif": {
25
- "bin": "ardent",
25
+ "bin": "ardent-beta",
26
26
  "dirname": "ardent",
27
27
  "commands": "./dist/commands",
28
28
  "helpClass": "./dist/help",