Documentation Index
Fetch the complete documentation index at: https://mintlify.com/21st-dev/1code/llms.txt
Use this file to discover all available pages before exploring further.
Welcome Contributors!
1Code is an open-source project, and we welcome contributions from the community. Whether you’re fixing bugs, adding features, improving documentation, or sharing feedback, your help makes 1Code better for everyone.By contributing to 1Code, you agree that your contributions will be licensed under the Apache License 2.0.
Ways to Contribute
Report Bugs
Found an issue? Let us know on GitHub Issues
Request Features
Have an idea? Share it in GitHub Discussions
Submit Code
Fix bugs or add features via Pull Requests
Improve Docs
Help make documentation clearer and more complete
Getting Started
Prerequisites
Before you start contributing, make sure you have:- Bun - Package manager and build tool
- Python 3.11+ - Required for native module compilation (setuptools needed for 3.12+)
- Git - Version control
- Xcode Command Line Tools (macOS only)
Development Setup
Development Commands
Project Structure
Understanding the codebase:Key Files
src/main/lib/db/schema/index.ts- Database schema (source of truth)src/main/lib/trpc/routers/- Backend API routessrc/renderer/features/agents/main/active-chat.tsx- Main chat UIelectron.vite.config.ts- Build configurationpackage.json- Dependencies and scripts
Making Changes
Creating a Feature Branch
Code Style
1Code uses TypeScript with strict mode enabled. Follow these conventions: Naming conventions:- Components:
PascalCase(ActiveChat.tsx,AgentsSidebar.tsx) - Utilities/hooks:
camelCase(useFileUpload.ts,formatters.ts) - Stores:
kebab-case(sub-chat-store.ts,agent-chat-store.ts) - Atoms:
camelCasewithAtomsuffix (selectedAgentChatIdAtom)
- Write TypeScript, not JavaScript
- Use functional components and hooks (React 19)
- Prefer Jotai atoms for UI state
- Prefer Zustand stores for complex state
- Use tRPC for main ↔ renderer communication
- Add JSDoc comments for complex functions
- Keep files focused and single-purpose
Database Changes
If you modify the database schema:Testing Your Changes
Before submitting a PR:-
Test in development:
-
Test a production build:
-
Test on a clean install:
Simulate a fresh install by clearing app data:
- Verify git worktrees work: Test creating, using, and deleting worktrees
- Check database migrations: Test on an existing database with data
Submitting a Pull Request
Commit your changes
Write clear, descriptive commit messages:Commit message format:
feat:- New featurefix:- Bug fixdocs:- Documentation changesrefactor:- Code refactoringtest:- Adding testschore:- Build process, dependencies
Create a Pull Request
- Go to the 1Code repository
- Click Pull Requests → New Pull Request
- Select your fork and branch
- Fill out the PR template:
- Clear title describing the change
- Detailed description of what and why
- Screenshots/videos for UI changes
- Testing steps
- Related issues (if any)
PR Guidelines
Good PRs:- Focus on a single feature or fix
- Include tests if applicable
- Update documentation if needed
- Have descriptive titles and descriptions
- Include screenshots for UI changes
- Pass all CI checks
- Mixing multiple unrelated changes
- Breaking changes without discussion
- Reformatting large amounts of existing code
- Adding dependencies without justification
- Changing build configuration unnecessarily
Open Source vs Hosted Version
1Code has both an open-source version and a hosted version at 1code.dev. Understand the differences:| Feature | Open Source | Hosted (1code.dev) |
|---|---|---|
| Local AI chat | ✅ Yes | ✅ Yes |
| Claude Code integration | ✅ Yes | ✅ Yes |
| Git worktrees | ✅ Yes | ✅ Yes |
| Terminal | ✅ Yes | ✅ Yes |
| Sign in / Sync | ❌ No | ✅ Yes |
| Background agents | ❌ No | ✅ Yes |
| Auto-updates | ❌ No | ✅ Yes |
| Private Discord & support | ❌ No | ✅ Yes |
| Early access to features | ❌ No | ✅ Yes |
- Core features should work in open source
- Backend-dependent features (sync, background agents) are closed source
- Document when a feature requires 1code.dev subscription
- Don’t add telemetry or tracking that’s enabled by default
Analytics & Telemetry
Analytics (PostHog) and error tracking (Sentry) are disabled by default in open source builds. They only activate if environment variables are set in.env.local:
- Always make it opt-in for open source
- Document what data is collected
- Respect user privacy
- Never collect code, credentials, or personal data
Community Guidelines
Communication
- Be respectful - Treat everyone with kindness and respect
- Be patient - Maintainers are volunteers with limited time
- Be constructive - Focus on solutions, not problems
- Be clear - Provide context, steps to reproduce, and examples
Where to Discuss
Discord
Real-time chat with the community
GitHub Issues
Bug reports and feature requests
GitHub Discussions
Questions, ideas, and general discussion
Twitter/X
Updates and announcements
Getting Help
If you’re stuck:- Check the documentation
- Search existing issues
- Ask in Discord
- Create a GitHub Discussion
- Clear description
- Steps to reproduce
- Expected vs actual behavior
- Environment (OS, version, build type)
- Logs or screenshots
License
1Code is licensed under the Apache License 2.0. This means you can:- Use the code commercially
- Modify the code
- Distribute the code
- Use it privately
- Grant patent rights
- Include the license and copyright notice
- State changes you make
- Include the NOTICE file if one exists
- Hold the authors liable
- Use trademarks without permission
Recognition
Contributors are recognized in:- GitHub contributors page
- Release notes (for significant contributions)
- The project README
Questions?
Not sure about something? Ask!- Discord: discord.gg/8ektTZGnj4
- GitHub Discussions: github.com/21st-dev/1code/discussions
- Email: support@21st.dev