pull/715/head
Travis Fischer 2025-05-27 02:13:30 +07:00
rodzic 09198abd29
commit a236dc58d7
6 zmienionych plików z 45 dodań i 4 usunięć

Wyświetl plik

@ -4,6 +4,7 @@ import { AgenticApiClient } from '@agentic/platform-api-client'
import { Command } from 'commander'
import restoreCursor from 'restore-cursor'
import { registerDebugCommand } from './commands/debug'
import { registerDeployCommand } from './commands/deploy'
import { registerGetDeploymentCommand } from './commands/get'
import { registerListDeploymentsCommand } from './commands/list'
@ -79,6 +80,7 @@ async function main() {
registerPublishCommand(ctx)
registerGetDeploymentCommand(ctx)
registerListDeploymentsCommand(ctx)
registerDebugCommand(ctx)
program.parse()
}

Wyświetl plik

@ -0,0 +1,39 @@
import { Command } from 'commander'
import { oraPromise } from 'ora'
import type { Context } from '../types'
import { AuthStore } from '../lib/auth-store'
import { loadAgenticConfig } from '../lib/load-agentic-config'
export function registerDebugCommand({ program, logger }: Context) {
const command = new Command('debug')
.description('Prints config for a local project.')
.option(
'-c, --cwd <dir>',
'The directory to load the Agentic project config from (defaults to cwd). This directory must contain an "agentic.config.{ts,js,json}" project file.'
)
.action(async (opts) => {
AuthStore.requireAuth()
// Load the Agentic project config, parse, and validate it. This will also
// validate any origin adapter config such as OpenAPI or MCP specs and
// embed them if they point to local files or URLs. Note that the server
// also performs validation; this is just a client-side convenience for
// failing fast and sharing 99% of the validation code between server and
// client.
const config = await oraPromise(
loadAgenticConfig({
cwd: opts.cwd
}),
{
text: `Loading Agentic config from ${opts.cwd}`,
successText: `Agentic config loaded successfully.`,
failText: 'Failed to load Agentic config.'
}
)
logger.log(config)
})
program.addCommand(command)
}

Wyświetl plik

@ -10,7 +10,7 @@ export function registerGetDeploymentCommand({
logger
}: Context) {
const command = new Command('get')
.description('Gets details for a specific deployment')
.description('Gets details for a specific deployment.')
.argument('<deploymentIdentifier>', 'Deployment ID or identifier')
.action(async (deploymentIdentifier) => {
AuthStore.requireAuth()

Wyświetl plik

@ -14,7 +14,7 @@ export function registerListDeploymentsCommand({
}: Context) {
const command = new Command('list')
.alias('ls')
.description('Lists deployments')
.description('Lists deployments.')
.argument('[projectIdentifier]', 'Optional project identifier')
.option('-v, --verbose', 'Display full deployments', false)
.action(async (projectIdentifier, opts) => {

Wyświetl plik

@ -6,7 +6,7 @@ import { AuthStore } from '../lib/auth-store'
export function registerSignoutCommand({ client, program, logger }: Context) {
const command = new Command('logout')
.alias('signout')
.description('Signs the current user out')
.description('Signs the current user out.')
.action(async () => {
if (!client.isAuthenticated) {
return

Wyświetl plik

@ -5,7 +5,7 @@ import { AuthStore } from '../lib/auth-store'
export function registerWhoAmICommand({ client, program, logger }: Context) {
const command = new Command('whoami')
.description('Displays info about the current user')
.description('Displays info about the current user.')
.action(async () => {
AuthStore.requireAuth()