Skip to content

feat: add oneclaw module for 1Claw MCP integration#845

Closed
kmjones1979 wants to merge 2 commits intocoder:mainfrom
kmjones1979:add-kmjones1979-oneclaw-module
Closed

feat: add oneclaw module for 1Claw MCP integration#845
kmjones1979 wants to merge 2 commits intocoder:mainfrom
kmjones1979:add-kmjones1979-oneclaw-module

Conversation

@kmjones1979
Copy link
Copy Markdown

Summary

  • Adds the kmjones1979 namespace and oneclaw module
  • Ported from 1clawAI/1claw-coder-workspace-module
  • Provides vault-backed secrets and MCP server configuration for AI coding agents (Cursor, Claude Code, etc.) in Coder workspaces
  • Three provisioning modes: Terraform-native, shell bootstrap, and manual

Files added

All under registry/kmjones1979/:

  • Namespace: README.md, .images/avatar.png (from GitHub)
  • Module (modules/oneclaw/): main.tf, variables.tf, outputs.tf, README.md
  • Scripts: scripts/provision.sh, scripts/bootstrap.sh, scripts/setup.sh
  • Tests: main.tftest.hcl (5 plan runs), main.test.ts (5 bun tests)

No shared repo files were modified.

Test plan

  • terraform validate passes
  • terraform test passes (Terraform 1.14 via Docker)
  • bun test main.test.ts passes (5/5)
  • ShellCheck passes on all .sh files
  • bun run fmt applied

Generated with Cursor using Claude

Made with Cursor

Add kmjones1979 namespace and oneclaw module, ported from
1clawAI/1claw-coder-workspace-module. Provides vault-backed secrets
and MCP server config for AI coding agents in Coder workspaces.

- Namespace: kmjones1979 (avatar from GitHub)
- Module: oneclaw with three provisioning modes (terraform-native,
  shell bootstrap, manual)
- Tests: main.tftest.hcl (5 runs) and main.test.ts (5 tests)
- Scripts: provision.sh, bootstrap.sh, setup.sh

Made-with: Cursor
@kmjones1979
Copy link
Copy Markdown
Author

Any feedback on this PR? I would be happy to adjust if anything is needed. Thanks.

@DevelopmentCats
Copy link
Copy Markdown
Collaborator

@kmjones1979
Sorry for the delay on this I had a family emergency, and was out for a few days.

I took a look at the changes, and I would like you to take a look at some of our modules in our coder namespace for a reference on what the structure should look like.

Generally in almost all cases you would just have: main.tf README.md main.test.ts main.tftest.hcl and script files which amount to maybe one or two scripts, but this is dependent on the module.

This is split up way more than usual, and does not follow the standards. If you use the new module script to scaffold this you might see what I mean here.

@DevelopmentCats
Copy link
Copy Markdown
Collaborator

@kmjones1979

I would resubmit this, but please follow the module style and schema, the scaffolding scripts definitely will help here

kmjones1979 added a commit to kmjones1979/registry that referenced this pull request Apr 22, 2026
…dling

Addresses reviewer feedback on closed PR coder#845 that the module was "split up
way more than usual" and did not follow the registry module schema.

Structure (matches the coder/ namespace conventions):
- Collapse variables.tf + outputs.tf into main.tf
- Merge scripts/bootstrap.sh + scripts/setup.sh into a single scripts/run.sh
  executed by a single coder_script
- Remove Terraform-native provisioning mode (scripts/provision.sh,
  null_resource.provision, master_api_key): it relied on local-exec writing a
  state file to the provisioner's cwd, which is ephemeral inside Coder template
  provisioners and therefore cannot round-trip credentials into coder_env
- Keep two supported modes: bootstrap (human 1ck_ key, recommended) and
  manual (pre-provisioned scoped ocv_ key)

Security hardening for the 1ck_ human bootstrap key:
- Deliver the key via a sensitive coder_env (_ONECLAW_HUMAN_API_KEY) instead
  of templatefile() substitution, so the literal key never appears in the
  rendered script body stored in Terraform state or logged to the workspace's
  /tmp/coder-agent.log
- Send the key to the 1Claw auth endpoint via curl --data-binary @- from stdin
  so it does not appear in process argv (ps/proc/cmdline)
- Unset HUMAN_KEY and _ONECLAW_HUMAN_API_KEY as soon as auth completes so
  downstream processes do not inherit the key
- Only the scoped ocv_ agent key and vault id are persisted to
  ~/.1claw/bootstrap.json and the MCP config files
- README documents post-bootstrap cleanup (set human_api_key = "" once the
  state file exists) and the full security guarantees

Tested end-to-end against a local Coder server with real 1Claw credentials:
first boot, idempotent restart, and post-bootstrap cleanup all succeed and
leave no copy of the 1ck_ value anywhere on the workspace filesystem or in
its process environments.

Made-with: Cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants