@staff0rd/assist 0.90.0 → 0.91.0

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.
@@ -4,8 +4,10 @@ description: Commit only relevant files from the session
4
4
 
5
5
  Review the git status and create a commit with only the files that are relevant to the current session. Write a clear, concise commit message that describes what changed and why. Do not reference Claude or any AI assistance in the commit message.
6
6
 
7
- Use `assist commit` with a message that is:
8
- - 40 characters or less
9
- - Does not reference Claude
7
+ First run `assist commit status` to see the current state of the working tree.
10
8
 
11
- Instead of using git commit directly, use: `assist commit "your message"`
9
+ Then use `assist commit <file1> <file2> ... "your message"` where:
10
+ - Each file argument is a path to git add before committing
11
+ - The last argument is the commit message
12
+ - The commit message is 40 characters or less
13
+ - The commit message does not reference Claude
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.90.0",
9
+ version: "0.91.0",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -220,8 +220,7 @@ function getTranscriptConfig() {
220
220
  // src/commands/commit.ts
221
221
  var MAX_MESSAGE_LENGTH = 50;
222
222
  var CONVENTIONAL_COMMIT_REGEX = /^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(!)?(\(.+\))?!?: .+$/;
223
- function commit(message) {
224
- const config = loadConfig();
223
+ function validateMessage(message, config) {
225
224
  if (message.toLowerCase().includes("claude")) {
226
225
  console.error("Error: Commit message must not reference Claude");
227
226
  process.exit(1);
@@ -238,16 +237,24 @@ function commit(message) {
238
237
  );
239
238
  process.exit(1);
240
239
  }
240
+ }
241
+ function escapeShell(s) {
242
+ return `"${s.replace(/"/g, '\\"')}"`;
243
+ }
244
+ function stageAndCommit(files, message) {
245
+ const escaped = files.map(escapeShell).join(" ");
246
+ execSync(`git add ${escaped}`, { stdio: "inherit" });
247
+ execSync(`git commit -m ${escapeShell(message)}`, { stdio: "inherit" });
248
+ return execSync("git rev-parse --short=7 HEAD", {
249
+ encoding: "utf-8"
250
+ }).trim();
251
+ }
252
+ function execCommit(files, message, config) {
241
253
  try {
242
254
  if (config.commit?.pull) {
243
255
  execSync("git pull", { stdio: "inherit" });
244
256
  }
245
- execSync(`git commit -m "${message.replace(/"/g, '\\"')}"`, {
246
- stdio: "inherit"
247
- });
248
- const sha = execSync("git rev-parse --short=7 HEAD", {
249
- encoding: "utf-8"
250
- }).trim();
257
+ const sha = stageAndCommit(files, message);
251
258
  console.log(`Committed: ${sha}`);
252
259
  if (config.commit?.push) {
253
260
  execSync("git push", { stdio: "inherit" });
@@ -258,6 +265,23 @@ function commit(message) {
258
265
  process.exit(1);
259
266
  }
260
267
  }
268
+ function commit(args) {
269
+ if (args[0] === "status") {
270
+ execSync("git status && echo '---DIFF---' && git diff", {
271
+ stdio: "inherit"
272
+ });
273
+ return;
274
+ }
275
+ if (args.length < 2) {
276
+ console.error("Usage: assist commit <files...> <message>");
277
+ process.exit(1);
278
+ }
279
+ const message = args[args.length - 1];
280
+ const files = args.slice(0, -1);
281
+ const config = loadConfig();
282
+ validateMessage(message, config);
283
+ execCommit(files, message, config);
284
+ }
261
285
 
262
286
  // src/commands/config/index.ts
263
287
  import chalk2 from "chalk";
@@ -6144,7 +6168,7 @@ var program = new Command();
6144
6168
  program.name("assist").description("CLI application").version(package_default.version);
6145
6169
  program.command("sync").description("Copy command files to ~/.claude/commands").option("-y, --yes", "Overwrite settings.json without prompting").action((options2) => sync(options2));
6146
6170
  program.command("init").description("Initialize VS Code and verify configurations").action(init4);
6147
- program.command("commit <message>").description("Create a git commit with validation").action(commit);
6171
+ program.command("commit").description("Create a git commit with validation").argument("<args...>", "status | <files...> <message>").action(commit);
6148
6172
  var configCommand = program.command("config").description("View and modify assist.yml configuration");
6149
6173
  configCommand.command("set <key> <value>").description("Set a config value (e.g. commit.push true)").action(configSet);
6150
6174
  configCommand.command("get <key>").description("Get a config value").action(configGet);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.90.0",
3
+ "version": "0.91.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {