Skip to content

Commit c5b0016

Browse files
committed
Merge branch 'main' into feature/hierarchical-config
2 parents 157b1b7 + 884fa4d commit c5b0016

File tree

13 files changed

+203
-293
lines changed

13 files changed

+203
-293
lines changed

.github/workflows/issue-comment.yml

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,31 @@ on:
44
issue_comment:
55
types: [created]
66

7+
# Top-level permissions apply to all jobs - this is the maximum allowed for GITHUB_TOKEN
78
permissions:
8-
contents: write
9-
issues: write
10-
pull-requests: write
9+
contents: write # Required for checkout, commit, push
10+
issues: write # Required for issue comments
11+
pull-requests: write # Required for creating PRs
12+
discussions: write # Added for more interaction capabilities
13+
statuses: write # Added for creating commit statuses
14+
checks: write # Added for creating check runs
15+
actions: read # Added for inspecting workflow runs
16+
packages: read # Added in case you need to access GitHub packages
1117

1218
env:
1319
PNPM_VERSION: 10.2.1
1420

1521
jobs:
1622
process-comment:
1723
runs-on: ubuntu-latest
18-
if: contains(github.event.comment.body, '/mycoder')
24+
# Only run if comment contains '/mycoder' AND commenter is in AUTHORIZED_USERS list
25+
if: |
26+
contains(github.event.comment.body, '/mycoder') &&
27+
contains(format(',{0},', 'bhouston'), format(',{0},', github.event.comment.user.login))
1928
steps:
2029
- name: Extract prompt from comment
2130
id: extract-prompt
2231
run: |
23-
COMMENT="${{ github.event.comment.body }}"
24-
if [[ "$COMMENT" =~ "/mycoder "(.+) ]]; then
25-
PROMPT="${BASH_REMATCH[1]}"
26-
elif [[ "$COMMENT" =~ "/mycoder" ]]; then
27-
# If just /mycoder with no text after, use a default prompt
28-
PROMPT="Please review this issue and suggest next steps."
29-
else
30-
echo "No valid /mycoder command found"
31-
exit 1
32-
fi
33-
echo "prompt=$PROMPT" >> $GITHUB_OUTPUT
3432
echo "comment_url=${{ github.event.comment.html_url }}" >> $GITHUB_OUTPUT
3533
echo "comment_id=${{ github.event.comment.id }}" >> $GITHUB_OUTPUT
3634
@@ -45,11 +43,25 @@ jobs:
4543
with:
4644
node-version-file: .nvmrc
4745

48-
- run: pnpm install -g mycoder
46+
- name: Configure Git
47+
run: |
48+
git config --global user.name "MyCoder (On behalf of ${{ github.event.comment.user.login }})"
49+
git config --global user.email "[email protected]"
50+
51+
- run:
52+
pnpm install -g mycoder
53+
54+
# Auth GitHub CLI with the token
55+
- name: Configure GitHub CLI
56+
run: |
57+
# First try with GITHUB_TOKEN
58+
echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
59+
# Verify auth status
60+
gh auth status
4961
5062
- env:
5163
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5264
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
5365
run: |
5466
echo "Running MyCoder for issue #${{ github.event.issue.number }} with prompt: ${{ steps.extract-prompt.outputs.prompt }}"
55-
mycoder --githubMode true --userPrompt false "On issue #${{ github.event.issue.number }} the user asked: '${{ steps.extract-prompt.outputs.prompt }}' in comment ${{ steps.extract-prompt.outputs.comment_url }}. Please address this request. If you create a PR or take actions outside the scope of this issue, please report back to the issue with a comment explaining what you did."
67+
mycoder --userWarning false --upgradeCheck false --githubMode true --userPrompt false "On issue #${{ github.event.issue.number }} in comment ${{ steps.extract-prompt.outputs.comment_url }} the user invoked the mycoder CLI via /mycoder. Can you try to do what they requested or if it is unclear, respond with a comment to that affect to encourage them to be more clear."

CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
1+
# [0.9.0](https://github.com/drivecore/mycoder/compare/v0.8.0...v0.9.0) (2025-03-11)
2+
3+
4+
### Bug Fixes
5+
6+
* don't save consent when using --userWarning=false ([41cf69d](https://github.com/drivecore/mycoder/commit/41cf69dee22acc31cd0f2aa9f80e36cd867fb20b))
7+
8+
9+
### Features
10+
11+
* add CLI options for automated usage scenarios ([00419bc](https://github.com/drivecore/mycoder/commit/00419bc3e060db6d0c18fc72e2d7b6957791c875))
12+
113
# [0.8.0](https://github.com/drivecore/mycoder/compare/v0.7.0...v0.8.0) (2025-03-11)
214

315
### Features
416

517
- add --githubMode and --userPrompt as boolean CLI options that override config settings ([0390f94](https://github.com/drivecore/mycoder/commit/0390f94651e40de93a8cb9486a056a0b9cb2e165))
6-
- implement hierarchical configuration system with project and global levels ([#153](https://github.com/drivecore/mycoder/issues/153))
718
- remove modelProvider and modelName - instant decrepation ([59834dc](https://github.com/drivecore/mycoder/commit/59834dcf932051a5c75624bd6f6ab12254f43769))
819

920
# [0.7.0](https://github.com/drivecore/mycoder/compare/v0.6.1...v0.7.0) (2025-03-10)

PR_DESCRIPTION.md

Lines changed: 0 additions & 59 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ mycoder --enableUserPrompt false "Generate a basic Express.js server"
3939
# or using the alias
4040
mycoder --userPrompt false "Generate a basic Express.js server"
4141

42+
# Disable user consent warning and version upgrade check for automated environments
43+
mycoder --userWarning false --upgradeCheck false "Generate a basic Express.js server"
44+
4245
# Enable GitHub mode via CLI option (overrides config)
4346
mycoder --githubMode "Work with GitHub issues and PRs"
4447

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mycoder-monorepo",
3-
"version": "0.8.0",
3+
"version": "0.9.0",
44
"type": "module",
55
"private": true,
66
"packageManager": "[email protected]",

packages/agent/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mycoder-agent",
3-
"version": "0.8.0",
3+
"version": "0.9.0",
44
"description": "Agent module for mycoder - an AI-powered software development assistant",
55
"type": "module",
66
"main": "dist/index.js",

packages/cli/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ mycoder "Implement a React component that displays a list of items"
3232
# Run with a prompt from a file
3333
mycoder -f prompt.txt
3434

35+
# Disable user prompts for fully automated sessions
36+
mycoder --userPrompt false "Generate a basic Express.js server"
37+
38+
# Disable user consent warning and version upgrade check for automated environments
39+
mycoder --userWarning false --upgradeCheck false "Generate a basic Express.js server"
40+
3541
# Enable GitHub mode
3642
mycoder config set githubMode true
3743
```
@@ -104,6 +110,14 @@ mycoder config set model claude-3-7-sonnet-20250219 # or any other Anthropic mo
104110
- `customPrompt`: Custom instructions to append to the system prompt for both main agent and sub-agents (default: `""`)
105111
- `tokenCache`: Enable token caching for LLM API calls (default: `true`)
106112

113+
### CLI-Only Options
114+
115+
These options are available only as command-line parameters and are not stored in the configuration:
116+
117+
- `userWarning`: Skip user consent check for current session without saving consent (default: `true`)
118+
- `upgradeCheck`: Disable version upgrade check for automated/remote usage (default: `true`)
119+
- `userPrompt`/`enableUserPrompt`: Enable or disable the userPrompt tool (default: `true`)
120+
107121
Example:
108122

109123
```bash

packages/cli/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "mycoder",
33
"description": "A command line tool using agent that can do arbitrary tasks, including coding tasks",
4-
"version": "0.8.0",
4+
"version": "0.9.0",
55
"type": "module",
66
"bin": "./bin/cli.js",
77
"main": "./dist/index.js",
@@ -49,7 +49,6 @@
4949
"dependencies": {
5050
"@sentry/node": "^9.3.0",
5151
"chalk": "^5",
52-
"deepmerge": "^4.3.1",
5352
"dotenv": "^16",
5453
"mycoder-agent": "workspace:*",
5554
"semver": "^7.7.1",

packages/cli/src/commands/$default.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,13 @@ export const command: CommandModule<SharedOptions, DefaultArgs> = {
5757
`MyCoder v${packageInfo.version} - AI-powered coding assistant`,
5858
);
5959

60-
await checkForUpdates(logger);
60+
// Skip version check if upgradeCheck is false
61+
if (argv.upgradeCheck !== false) {
62+
await checkForUpdates(logger);
63+
}
6164

62-
if (!hasUserConsented()) {
65+
// Skip user consent check if userWarning is false
66+
if (!hasUserConsented() && argv.userWarning !== false) {
6367
const readline = createInterface({
6468
input: process.stdin,
6569
output: process.stdout,
@@ -81,6 +85,10 @@ export const command: CommandModule<SharedOptions, DefaultArgs> = {
8185
logger.info('User did not consent. Exiting.');
8286
throw new Error('User did not consent');
8387
}
88+
} else if (!hasUserConsented() && argv.userWarning === false) {
89+
// Just skip the consent check without saving consent when userWarning is false
90+
logger.debug('Skipping user consent check due to --userWarning=false');
91+
// Note: We don't save consent here, just bypassing the check for this session
8492
}
8593

8694
const tokenTracker = new TokenTracker(

0 commit comments

Comments
 (0)