staticx 0.1.0 → 0.1.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/package.json +1 -1
  2. package/src/index.js +14 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "staticx",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Public CLI for STATICX using token-authenticated /api/v1 routes.",
5
5
  "type": "module",
6
6
  "publishConfig": {
package/src/index.js CHANGED
@@ -14,9 +14,7 @@ export async function run(argv) {
14
14
  program
15
15
  .name('staticx')
16
16
  .description('Public CLI for STATICX using token-authenticated /api/v1 routes.')
17
- .version('0.1.0')
18
- .option('--base-url <url>', 'STATICX API base URL, for example https://staticx.site/api/v1')
19
- .option('--token <token>', 'STATICX bearer token')
17
+ .version('0.1.1')
20
18
  .showHelpAfterError();
21
19
 
22
20
  program
@@ -60,6 +58,8 @@ export async function run(argv) {
60
58
  .command('whoami')
61
59
  .description('Verify the stored token and print the current user/token metadata.')
62
60
  .option('--json', 'Print JSON output')
61
+ .option('--base-url <url>', 'Override the stored STATICX API base URL')
62
+ .option('--token <token>', 'Override the stored STATICX bearer token')
63
63
  .action(async (options, command) => {
64
64
  const client = await clientFromCommand(command);
65
65
  const response = await client.get('/user');
@@ -81,6 +81,8 @@ export async function run(argv) {
81
81
  .command('workspaces')
82
82
  .description('List workspaces visible to the current token.')
83
83
  .option('--json', 'Print JSON output')
84
+ .option('--base-url <url>', 'Override the stored STATICX API base URL')
85
+ .option('--token <token>', 'Override the stored STATICX bearer token')
84
86
  .action(async (options, command) => {
85
87
  const client = await clientFromCommand(command);
86
88
  const response = await client.get('/workspaces');
@@ -104,6 +106,8 @@ export async function run(argv) {
104
106
  .description('List sites visible to the current token, optionally filtered by workspace.')
105
107
  .option('--workspace-id <id>', 'Filter by workspace ID')
106
108
  .option('--json', 'Print JSON output')
109
+ .option('--base-url <url>', 'Override the stored STATICX API base URL')
110
+ .option('--token <token>', 'Override the stored STATICX bearer token')
107
111
  .action(async (options, command) => {
108
112
  const client = await clientFromCommand(command);
109
113
  const response = await client.get('/projects', {
@@ -134,6 +138,8 @@ export async function run(argv) {
134
138
  .option('--archive <path>', 'ZIP archive path to seed the site')
135
139
  .option('--source-url <url>', 'Public URL to import into the site')
136
140
  .option('--json', 'Print JSON output')
141
+ .option('--base-url <url>', 'Override the stored STATICX API base URL')
142
+ .option('--token <token>', 'Override the stored STATICX bearer token')
137
143
  .action(async (options, command) => {
138
144
  if (options.archive && options.sourceUrl) {
139
145
  throw new Error('Use either --archive or --source-url, not both.');
@@ -171,6 +177,8 @@ export async function run(argv) {
171
177
  .requiredOption('--site-id <id>', 'Site ID')
172
178
  .requiredOption('--dir <path>', 'Built site directory, for example dist')
173
179
  .option('--json', 'Print JSON output')
180
+ .option('--base-url <url>', 'Override the stored STATICX API base URL')
181
+ .option('--token <token>', 'Override the stored STATICX bearer token')
174
182
  .action(async (options, command) => {
175
183
  const client = await clientFromCommand(command);
176
184
  const zipPath = await createZipFromDirectory(options.dir);
@@ -222,6 +230,8 @@ export async function run(argv) {
222
230
  .requiredOption('--site-id <id>', 'Site ID')
223
231
  .option('--limit <number>', 'Maximum number of log rows', '25')
224
232
  .option('--json', 'Print JSON output')
233
+ .option('--base-url <url>', 'Override the stored STATICX API base URL')
234
+ .option('--token <token>', 'Override the stored STATICX bearer token')
225
235
  .action(async (options, command) => {
226
236
  const client = await clientFromCommand(command);
227
237
  const response = await client.get(`/projects/${options.siteId}/logs`, {
@@ -246,7 +256,7 @@ export async function run(argv) {
246
256
  }
247
257
 
248
258
  async function clientFromCommand(command) {
249
- const options = command.optsWithGlobals ? command.optsWithGlobals() : command.opts();
259
+ const options = command.opts();
250
260
  const auth = await resolveRuntimeAuth(options);
251
261
 
252
262
  return new StaticxApiClient(auth);