@staff0rd/assist 0.99.0 → 0.100.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.
package/README.md CHANGED
@@ -74,7 +74,7 @@ After installation, the `assist` command will be available globally. You can als
74
74
  - `assist backlog delete <id>` - Delete a backlog item
75
75
  - `assist backlog web [-p, --port <number>]` - Start a web view of the backlog (default port 3000)
76
76
  - `assist roam auth` - Authenticate with Roam via OAuth (opens browser, saves tokens to ~/.assist.yml)
77
- - `assist run <name>` - Run a configured command from assist.yml
77
+ - `assist run <name> [params...]` - Run a configured command from assist.yml (positional params are matched to `params` config)
78
78
  - `assist run add` - Add a new run configuration to assist.yml and create a Claude command file
79
79
  - `assist config set <key> <value>` - Set a config value (e.g. commit.push true)
80
80
  - `assist config get <key>` - Get a config value
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { Command } from "commander";
6
6
  // package.json
7
7
  var package_default = {
8
8
  name: "@staff0rd/assist",
9
- version: "0.99.0",
9
+ version: "0.100.1",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -99,10 +99,17 @@ function loadRawYaml(path35) {
99
99
 
100
100
  // src/shared/types.ts
101
101
  import { z } from "zod";
102
+ var runParamSchema = z.strictObject({
103
+ name: z.string(),
104
+ required: z.boolean().optional(),
105
+ default: z.string().optional(),
106
+ description: z.string().optional()
107
+ });
102
108
  var runConfigSchema = z.strictObject({
103
109
  name: z.string(),
104
110
  command: z.string(),
105
111
  args: z.array(z.string()).optional(),
112
+ params: z.array(runParamSchema).optional(),
106
113
  env: z.record(z.string(), z.string()).optional(),
107
114
  filter: z.string().optional()
108
115
  });
@@ -6727,6 +6734,30 @@ function registerRoam(program2) {
6727
6734
  // src/commands/run/index.ts
6728
6735
  import { spawn as spawn5 } from "child_process";
6729
6736
 
6737
+ // src/commands/run/resolveParams.ts
6738
+ function resolveParams(params, cliArgs) {
6739
+ if (!params || params.length === 0) return cliArgs;
6740
+ const resolved = [];
6741
+ const missing = [];
6742
+ for (let i = 0; i < params.length; i++) {
6743
+ const param = params[i];
6744
+ const value = cliArgs[i] ?? param.default;
6745
+ if (value !== void 0) {
6746
+ resolved.push(value);
6747
+ } else if (param.required) {
6748
+ missing.push(param.name);
6749
+ }
6750
+ }
6751
+ if (missing.length > 0) {
6752
+ const s = missing.length > 1 ? "s" : "";
6753
+ const names = missing.map((n) => `"${n}"`).join(", ");
6754
+ console.error(`Missing required param${s}: ${names}`);
6755
+ process.exit(1);
6756
+ }
6757
+ resolved.push(...cliArgs.slice(params.length));
6758
+ return resolved;
6759
+ }
6760
+
6730
6761
  // src/commands/run/add.ts
6731
6762
  import { mkdirSync as mkdirSync11, writeFileSync as writeFileSync22 } from "fs";
6732
6763
  import { join as join30 } from "path";
@@ -6855,8 +6886,9 @@ function listRunConfigs() {
6855
6886
  }
6856
6887
  function run2(name, args) {
6857
6888
  const runConfig = findRunConfig(name);
6889
+ const resolved = resolveParams(runConfig.params, args);
6858
6890
  spawnCommand2(
6859
- buildCommand(runConfig.command, runConfig.args ?? [], args),
6891
+ buildCommand(runConfig.command, runConfig.args ?? [], resolved),
6860
6892
  runConfig.env
6861
6893
  );
6862
6894
  }
@@ -7034,7 +7066,10 @@ var runCommand = program.command("run").description("Run a configured command fr
7034
7066
  run2(name, args);
7035
7067
  });
7036
7068
  runCommand.command("list").description("List configured run commands").action(listRunConfigs);
7037
- runCommand.command("add").description("Add a new run configuration to assist.yml").allowUnknownOption().allowExcessArguments().action(() => add2());
7069
+ runCommand.command("add").description("Add a new run configuration to assist.yml").argument("<name>", "Name for the run configuration").argument("<command>", "Command to execute").argument("[args...]", "Static args to pass to the command").addHelpText(
7070
+ "after",
7071
+ '\nPositional params can be added to the config manually:\n params:\n - name: env # assist run deploy prod \u2192 appends "prod"\n required: true\n - name: tag\n default: latest'
7072
+ ).allowUnknownOption().allowExcessArguments().action(() => add2());
7038
7073
  registerNew(program);
7039
7074
  var lintCommand = program.command("lint").description("Run lint checks for conventions not enforced by biomejs").action(lint);
7040
7075
  lintCommand.command("init").description("Initialize Biome with standard linter config").action(init);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.99.0",
3
+ "version": "0.100.1",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {