0.1.0 • Published 4 months ago

gongsho v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

gongsho

An NPM library to add AI CodeGen to your typescript project. Simply install npm i gongsho then run the start command to open the gongsho web interface. It reads your project files and allows you to have a conversation with the LLM to generate code.

Gongsho uses Claude Sonnet, you'll need an Anthropic API key to use it. Support for additional LLMs is coming soon.

See a live Demo

Live Demo on Youtube

Gongsho UI

Install and Run

You can either install gongsho in a project or globally.

# make sure you have node 18 or higher
node -v
# make sure > v18

# install in a project
npm install gongsho@latest  --save-dev

You'll need to get an Anthropic API key and pass it to gongsho.

# If you have an ANTHROPIC_API_KEY env variable in your bash profile.
npx gongsho --anthropic-api-key=$ANTHROPIC_API_KEY

Configuration

The following options are available to configure gongsho:

  • ANTHROPIC_API_KEY (required) get your key from Anthropic
  • PORT (optional) default is 3030
  • MAX_FILES (optional) You'll get a warning if your project has more files than this. Default is 800.
  • PROJECT_PATH (optional) The path to the project root. Default is the current working directory.

You can either pass them in as flags or as an .env file.

Pass as flags example:

npx gongsho --anthropic-api-key=$ANTHROPIC_API_KEY --port=3030

Point to an .env file:

npx gongsho --env-file=.env.gongsho
# .env.gongsho
ANTHROPIC_API_KEY=sk-ant-api03-Iw....
PORT=3030
MAX_FILES=800

.gongshoignore

When you have many files in a project you can create a .gongshoignore file to exclude files from the conversation. This will greatly improve performance. When you don't create a custom .gongshoignore file, gongsho will use the .gitignore file. There are additionally some sensible defaults that will always be ignored.

TODOs

  • MVP for v0.2.0

    • Show better UI for CHANGELIST
    • Verify larger project support
    • Show previous conversations
    • Auto Scroll to the bottom of the conversation
  • LLM

    • Make initial prompt asking if codebase explanation is required
    • Make interstitial
    • Pass full text of files to LLM if explanation is required
    • Save/Load conversation to/from file
    • increase performance on large projects
    • refine prompts with examples from Anthropic Code in NPM. Prompts gist
    • Add getFiles tooling
    • Add getDependencies tooling
  • UI

    • Sticky top nav with button "New Conversation",
    • UI to see your history : "View Conversations"
    • Fix the apply button - for errors and for clearing
    • Add diff viewer of changes
    • Add ability to add files manually to the conversation
    • Allow switching between agents
    • Add apply button to apply changes to the project
    • event stream
    • event fragments for text
    • event fragments for code blocks
  • Server

    • Add getConversations endpoint
    • Add getConversation endpoint
    • Add createConversation endpoint
    • Add addUserInput endpoint
    • Add stream conversation endpoint (SSE/ws)
    • Add getChanges to a conversation
    • Add getFiles endpoint
    • Improve logging
  • Assistant TODOs

    • Build a prompt for Claude to understand the project folder and the user's objective
    • Take claude's response and apply it to the project folder
    • Add basic RepoMap with simple list of files
    • Add aider like prompts to gongsho
    • Implement RepoMap similar to Aider Repo-Map
    • Optimize changelog generation
    • Add prompt caching, Vercel, Anthropic
    • Research Tree-Splitter to give more context to LLM
    • Research Token size limits for user input and repo-maps
    • convert to Vercel AI SDK
    • Research LangGraph multi-agent workflows
    • Deal with finishReason better
  • Features Ideas

    • Browse the codebase
    • Highlight code snippet and explain it
    • Highlight code snippet and ask for a change
    • Add "Explain My Project" feature
    • Add "Rules" feature for the AI to follow
    • Facilitate update with UI notification to update gongsho Gongsho Update Feed + Compare Versions
  • Bugs

    • Add new file creation, during conversation
    • Agent dropdown on textarea not hooked in, make textarea only clear when successfully applied
    • Theres an extra conversations load http://localhost:4200/api/conversations/ on the conversation details page
    • Deal with Agent errors better
    • When the LLM Agent gives an error, the UI has already cleared the text area too early.
    • Fix the error on SSE completion from our SSE dependency: ngx-sse-client
  • Backlog

    • Better way to handle titles of created conversations.
    • Upgrade nestjs to latest (Note: We had to install an old version of @nestjs/serve-static@10.4.15 due to NX compatibility).
0.1.0

4 months ago

0.0.1-4

5 months ago

0.0.1-3

5 months ago

0.0.1-2

5 months ago

0.0.1-1

5 months ago

0.0.1-0

5 months ago

0.0.0

5 months ago