codesavant 3.4.1 → 4.0.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.
- package/README.md +183 -325
- package/dist/cli.js +42917 -16920
- package/package.json +15 -5
- package/scripts/postinstall.cjs +103 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# CodeSavant
|
|
2
2
|
|
|
3
|
-
> AI-powered coding
|
|
3
|
+
> AI-powered autonomous coding agent CLI that brings Claude, GPT-4, and other leading AI models directly to your terminal. Features autonomous workflows, a skill marketplace, self-improving brain, and design intelligence.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/codesavant)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
@@ -8,22 +8,34 @@
|
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## What's New in v4.0
|
|
12
12
|
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
- 🔌 **MCP Integration** - Model Context Protocol support for extensibility
|
|
19
|
-
- 🎭 **Craft Skills** - AI-powered workflows for TDD, debugging, planning, and code review
|
|
20
|
-
- 🚀 **Multiple Execution Modes** - Interactive, single-command, pipe mode, or resume sessions
|
|
21
|
-
- 🛡️ **Security First** - Permission system with SSRF protection and command validation
|
|
22
|
-
- 📊 **Context Management** - Automatic token tracking and conversation compression
|
|
13
|
+
- **Autonomous /craft Cycle** - End-to-end feature building: research, question, plan, build, verify -- all orchestrated automatically
|
|
14
|
+
- **Skill Marketplace** - Browse, install, and publish reusable AI skills with version management and hash verification
|
|
15
|
+
- **Self-Improving Brain** - Cross-session learning that detects patterns, captures failures, and optimizes over time
|
|
16
|
+
- **Design Intelligence Foundation** - Frontend detection, design token vocabulary, and DesignBrief schemas for style-aware code generation
|
|
17
|
+
- **360+ Test Files** - Comprehensive test coverage across unit, integration, e2e, performance, and security suites
|
|
23
18
|
|
|
24
19
|
---
|
|
25
20
|
|
|
26
|
-
##
|
|
21
|
+
## Features
|
|
22
|
+
|
|
23
|
+
- **Multi-Provider Support** - Works with Anthropic Claude, OpenAI GPT-4, Groq, DeepSeek, Google Gemini, Ollama, and AWS Bedrock
|
|
24
|
+
- **Interactive REPL** - Rich terminal interface with streaming responses and real-time tool execution
|
|
25
|
+
- **20+ Built-in Tools** - File operations, web search, code analysis, task management
|
|
26
|
+
- **Autonomous Agent** - Self-directed research, questioning, planning, and building via /craft
|
|
27
|
+
- **Skill Marketplace** - Browse, install, and publish community skills
|
|
28
|
+
- **Self-Improving Brain** - Pattern detection, failure capture, and cross-session learning
|
|
29
|
+
- **Design Intelligence** - Frontend detection, style vocabulary, and design token resolution
|
|
30
|
+
- **Craft Skills** - AI-powered workflows for TDD, debugging, planning, and code review
|
|
31
|
+
- **Session Management** - Save, resume, and checkpoint your conversations
|
|
32
|
+
- **MCP Integration** - Model Context Protocol support for extensibility
|
|
33
|
+
- **Security First** - Permission system with SSRF protection and command validation
|
|
34
|
+
- **Context Management** - Automatic token tracking and conversation compression
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Installation
|
|
27
39
|
|
|
28
40
|
CodeSavant requires [Bun](https://bun.sh) runtime (v1.0.0+).
|
|
29
41
|
|
|
@@ -49,7 +61,7 @@ npm install -g codesavant
|
|
|
49
61
|
|
|
50
62
|
---
|
|
51
63
|
|
|
52
|
-
##
|
|
64
|
+
## Quick Start
|
|
53
65
|
|
|
54
66
|
### 1. Launch Interactive REPL
|
|
55
67
|
|
|
@@ -95,7 +107,7 @@ file: src/utils/parser.ts
|
|
|
95
107
|
|
|
96
108
|
---
|
|
97
109
|
|
|
98
|
-
##
|
|
110
|
+
## Usage
|
|
99
111
|
|
|
100
112
|
### Command-Line Interface
|
|
101
113
|
|
|
@@ -144,7 +156,7 @@ codesavant --strict
|
|
|
144
156
|
|
|
145
157
|
---
|
|
146
158
|
|
|
147
|
-
##
|
|
159
|
+
## REPL Commands
|
|
148
160
|
|
|
149
161
|
Once in the interactive REPL, use these slash commands:
|
|
150
162
|
|
|
@@ -194,7 +206,7 @@ Once in the interactive REPL, use these slash commands:
|
|
|
194
206
|
|
|
195
207
|
---
|
|
196
208
|
|
|
197
|
-
##
|
|
209
|
+
## Supported AI Providers
|
|
198
210
|
|
|
199
211
|
### Anthropic Claude
|
|
200
212
|
|
|
@@ -300,9 +312,9 @@ codesavant --provider bedrock --model anthropic.claude-3-sonnet-20240229-v1:0
|
|
|
300
312
|
|
|
301
313
|
---
|
|
302
314
|
|
|
303
|
-
##
|
|
315
|
+
## Autonomous /craft Workflows
|
|
304
316
|
|
|
305
|
-
|
|
317
|
+
The `/craft` command provides fully autonomous AI workflows that research, plan, build, and verify features end-to-end.
|
|
306
318
|
|
|
307
319
|
### Process Skills (Use First)
|
|
308
320
|
|
|
@@ -314,22 +326,6 @@ Craft skills are specialized AI workflows for software engineering tasks.
|
|
|
314
326
|
/craft diagnose <bug description>
|
|
315
327
|
```
|
|
316
328
|
|
|
317
|
-
**Example:**
|
|
318
|
-
```
|
|
319
|
-
> /craft ideate user authentication system
|
|
320
|
-
|
|
321
|
-
│ I'm using the ideate skill to brainstorm the authentication system.
|
|
322
|
-
│
|
|
323
|
-
│ Let's explore the requirements. What authentication method do you prefer?
|
|
324
|
-
│ 1. JWT tokens (stateless)
|
|
325
|
-
│ 2. Session-based (server-side state)
|
|
326
|
-
│ 3. OAuth 2.0 (third-party)
|
|
327
|
-
│
|
|
328
|
-
> 1
|
|
329
|
-
|
|
330
|
-
│ Great choice! Let's design a JWT-based auth system...
|
|
331
|
-
```
|
|
332
|
-
|
|
333
329
|
### Implementation Skills (During Work)
|
|
334
330
|
|
|
335
331
|
```bash
|
|
@@ -349,23 +345,6 @@ Craft skills are specialized AI workflows for software engineering tasks.
|
|
|
349
345
|
/craft workspace <feature-name>
|
|
350
346
|
```
|
|
351
347
|
|
|
352
|
-
**Example:**
|
|
353
|
-
```
|
|
354
|
-
> /craft proof login endpoint
|
|
355
|
-
|
|
356
|
-
│ I'm using TDD workflow. Let me write failing tests first...
|
|
357
|
-
│
|
|
358
|
-
[Tool: Write] ✓ Complete
|
|
359
|
-
file: tests/auth/login.test.ts
|
|
360
|
-
|
|
361
|
-
│ Tests written. Running to verify they fail...
|
|
362
|
-
│
|
|
363
|
-
[Tool: Bash] ✓ Complete
|
|
364
|
-
command: bun test tests/auth/login.test.ts
|
|
365
|
-
|
|
366
|
-
│ ✗ 3 tests failing (expected). Now implementing minimal code to pass...
|
|
367
|
-
```
|
|
368
|
-
|
|
369
348
|
### Quality Skills (After Work)
|
|
370
349
|
|
|
371
350
|
```bash
|
|
@@ -379,9 +358,61 @@ command: bun test tests/auth/login.test.ts
|
|
|
379
358
|
/craft ship
|
|
380
359
|
```
|
|
381
360
|
|
|
361
|
+
### Full Autonomous Cycle
|
|
362
|
+
|
|
363
|
+
```bash
|
|
364
|
+
# Fully autonomous: research → question → plan → build → verify
|
|
365
|
+
/craft <feature description>
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
The craft orchestrator spawns research agents in parallel, asks targeted questions, builds a development roadmap, executes plans with atomic commits, and verifies output quality -- all autonomously.
|
|
369
|
+
|
|
382
370
|
---
|
|
383
371
|
|
|
384
|
-
##
|
|
372
|
+
## Skill Marketplace
|
|
373
|
+
|
|
374
|
+
Browse and install community-created skills, or publish your own.
|
|
375
|
+
|
|
376
|
+
```bash
|
|
377
|
+
# Browse available skills
|
|
378
|
+
/skills marketplace
|
|
379
|
+
|
|
380
|
+
# Install a skill
|
|
381
|
+
/skills install <skill-name>
|
|
382
|
+
|
|
383
|
+
# Publish your skill
|
|
384
|
+
/skills publish <skill-path>
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
Skills are verified with SHA-256 hash integrity checks, support semantic versioning, and handle slug collisions gracefully.
|
|
388
|
+
|
|
389
|
+
---
|
|
390
|
+
|
|
391
|
+
## Self-Improving Brain
|
|
392
|
+
|
|
393
|
+
CodeSavant learns across sessions:
|
|
394
|
+
|
|
395
|
+
- **Pattern Detection** - Identifies recurring coding patterns and preferences
|
|
396
|
+
- **Failure Capture** - Records what went wrong and how it was fixed
|
|
397
|
+
- **Optimization** - Detects opportunities to improve workflows
|
|
398
|
+
- **Memory Resolution** - Three-tier priority system (project > user > global)
|
|
399
|
+
|
|
400
|
+
The brain operates transparently -- it writes insights after sessions and reads them before the next one, getting better over time without manual configuration.
|
|
401
|
+
|
|
402
|
+
---
|
|
403
|
+
|
|
404
|
+
## Design Intelligence
|
|
405
|
+
|
|
406
|
+
CodeSavant automatically detects frontend work and applies design-aware context:
|
|
407
|
+
|
|
408
|
+
- **Frontend Detection** - Identifies frontend tasks from file extensions (.tsx, .jsx, .css, .vue, .svelte), import patterns, and intent keywords
|
|
409
|
+
- **Style Vocabulary** - 50+ design buzzwords (minimal, bold, cinematic, etc.) mapped to concrete design tokens
|
|
410
|
+
- **Design Brief Schema** - Structured, validated design preferences with opinionated defaults
|
|
411
|
+
- **Token Resolution** - Translates style buzzwords into actionable token hints (border-radius, spacing, contrast, etc.)
|
|
412
|
+
|
|
413
|
+
---
|
|
414
|
+
|
|
415
|
+
## Built-in Tools
|
|
385
416
|
|
|
386
417
|
CodeSavant provides 20+ tools that AI can use to help you:
|
|
387
418
|
|
|
@@ -428,7 +459,7 @@ CodeSavant provides 20+ tools that AI can use to help you:
|
|
|
428
459
|
|
|
429
460
|
---
|
|
430
461
|
|
|
431
|
-
##
|
|
462
|
+
## Configuration
|
|
432
463
|
|
|
433
464
|
### Settings File
|
|
434
465
|
|
|
@@ -498,193 +529,7 @@ Follow these steps to deploy:
|
|
|
498
529
|
|
|
499
530
|
---
|
|
500
531
|
|
|
501
|
-
##
|
|
502
|
-
|
|
503
|
-
CodeSavant features a modern "Aurora" color scheme:
|
|
504
|
-
|
|
505
|
-
- **Electric Blue** - Assistant messages, primary UI
|
|
506
|
-
- **Aqua** - User input, selections
|
|
507
|
-
- **Emerald** - Success states, completions
|
|
508
|
-
- **Amber** - Warnings, processing
|
|
509
|
-
- **Crimson** - Errors, failures
|
|
510
|
-
- **Violet** - Keywords, special states
|
|
511
|
-
|
|
512
|
-
Colors are optimized for terminal readability on both light and dark backgrounds.
|
|
513
|
-
|
|
514
|
-
---
|
|
515
|
-
|
|
516
|
-
## 💡 Examples
|
|
517
|
-
|
|
518
|
-
### Example 1: Code Review
|
|
519
|
-
|
|
520
|
-
```bash
|
|
521
|
-
codesavant
|
|
522
|
-
|
|
523
|
-
> Review the changes in src/auth.ts and suggest improvements
|
|
524
|
-
|
|
525
|
-
[Tool: Read] ✓ Complete
|
|
526
|
-
file: src/auth.ts
|
|
527
|
-
|
|
528
|
-
│ I've reviewed the authentication code. Here are my findings:
|
|
529
|
-
│
|
|
530
|
-
│ **Security Issues:**
|
|
531
|
-
│ 1. Line 23: Password stored in plaintext - should use bcrypt
|
|
532
|
-
│ 2. Line 45: JWT secret hardcoded - move to environment variable
|
|
533
|
-
│
|
|
534
|
-
│ **Code Quality:**
|
|
535
|
-
│ 1. Consider extracting validation logic into separate function
|
|
536
|
-
│ 2. Add error handling for database connection failures
|
|
537
|
-
│
|
|
538
|
-
│ Would you like me to fix these issues?
|
|
539
|
-
|
|
540
|
-
> Yes, fix the security issues
|
|
541
|
-
|
|
542
|
-
[Tool: Edit] ✓ Complete
|
|
543
|
-
file: src/auth.ts
|
|
544
|
-
|
|
545
|
-
│ I've updated the code to:
|
|
546
|
-
│ - Hash passwords with bcrypt
|
|
547
|
-
│ - Load JWT secret from environment variable
|
|
548
|
-
│ - Add proper error handling
|
|
549
|
-
│
|
|
550
|
-
│ Changes made to src/auth.ts (lines 23-50)
|
|
551
|
-
```
|
|
552
|
-
|
|
553
|
-
### Example 2: TDD Workflow
|
|
554
|
-
|
|
555
|
-
```bash
|
|
556
|
-
codesavant
|
|
557
|
-
|
|
558
|
-
> /craft proof user registration endpoint
|
|
559
|
-
|
|
560
|
-
│ Starting TDD workflow. Writing failing tests first...
|
|
561
|
-
|
|
562
|
-
[Tool: Write] ✓ Complete
|
|
563
|
-
file: tests/api/register.test.ts
|
|
564
|
-
|
|
565
|
-
│ Test cases written:
|
|
566
|
-
│ 1. Should register new user with valid data
|
|
567
|
-
│ 2. Should reject duplicate email
|
|
568
|
-
│ 3. Should validate password strength
|
|
569
|
-
│ 4. Should return JWT token on success
|
|
570
|
-
│
|
|
571
|
-
│ Running tests...
|
|
572
|
-
|
|
573
|
-
[Tool: Bash] ✓ Complete
|
|
574
|
-
command: bun test tests/api/register.test.ts
|
|
575
|
-
|
|
576
|
-
│ ✗ All 4 tests failing (expected)
|
|
577
|
-
│
|
|
578
|
-
│ Now implementing minimal code to pass tests...
|
|
579
|
-
|
|
580
|
-
[Tool: Write] ✓ Complete
|
|
581
|
-
file: src/api/register.ts
|
|
582
|
-
|
|
583
|
-
[Tool: Bash] ✓ Complete
|
|
584
|
-
command: bun test tests/api/register.test.ts
|
|
585
|
-
|
|
586
|
-
│ ✓ All 4 tests passing!
|
|
587
|
-
│
|
|
588
|
-
│ Implementation complete. Ready to commit?
|
|
589
|
-
|
|
590
|
-
> Yes
|
|
591
|
-
|
|
592
|
-
[Tool: Bash] ✓ Complete
|
|
593
|
-
command: git add . && git commit -m "feat: add user registration endpoint"
|
|
594
|
-
```
|
|
595
|
-
|
|
596
|
-
### Example 3: Debugging
|
|
597
|
-
|
|
598
|
-
```bash
|
|
599
|
-
codesavant
|
|
600
|
-
|
|
601
|
-
> My app crashes with "Cannot read property 'name' of undefined"
|
|
602
|
-
|
|
603
|
-
│ Let's debug this systematically. Can you share the error stack trace
|
|
604
|
-
│ or the file where the error occurs?
|
|
605
|
-
|
|
606
|
-
> Read src/components/UserProfile.tsx
|
|
607
|
-
|
|
608
|
-
[Tool: Read] ✓ Complete
|
|
609
|
-
file: src/components/UserProfile.tsx
|
|
610
|
-
|
|
611
|
-
│ Found the issue at line 15:
|
|
612
|
-
│
|
|
613
|
-
│ ```typescript
|
|
614
|
-
│ const userName = user.name; // user might be undefined
|
|
615
|
-
│ ```
|
|
616
|
-
│
|
|
617
|
-
│ The problem is accessing `user.name` without checking if `user` exists first.
|
|
618
|
-
│
|
|
619
|
-
│ Root cause: The component renders before the user data is loaded.
|
|
620
|
-
│
|
|
621
|
-
│ Fix: Add a loading check:
|
|
622
|
-
│
|
|
623
|
-
│ ```typescript
|
|
624
|
-
│ if (!user) return <Loading />;
|
|
625
|
-
│ const userName = user.name;
|
|
626
|
-
│ ```
|
|
627
|
-
│
|
|
628
|
-
│ Should I apply this fix?
|
|
629
|
-
|
|
630
|
-
> Yes
|
|
631
|
-
|
|
632
|
-
[Tool: Edit] ✓ Complete
|
|
633
|
-
file: src/components/UserProfile.tsx
|
|
634
|
-
```
|
|
635
|
-
|
|
636
|
-
### Example 4: Pipe Mode
|
|
637
|
-
|
|
638
|
-
```bash
|
|
639
|
-
# Analyze an error log
|
|
640
|
-
cat error.log | codesavant --pipe -p "analyze this error and suggest a fix"
|
|
641
|
-
|
|
642
|
-
# Review a diff
|
|
643
|
-
git diff | codesavant --pipe -p "review these changes"
|
|
644
|
-
|
|
645
|
-
# Explain code
|
|
646
|
-
cat complex-algorithm.ts | codesavant --pipe -p "explain this algorithm step by step"
|
|
647
|
-
```
|
|
648
|
-
|
|
649
|
-
### Example 5: Session Management
|
|
650
|
-
|
|
651
|
-
```bash
|
|
652
|
-
# Start working on a feature
|
|
653
|
-
codesavant
|
|
654
|
-
|
|
655
|
-
> I need to add OAuth authentication
|
|
656
|
-
|
|
657
|
-
│ Let's plan the OAuth implementation...
|
|
658
|
-
│ [Long conversation with code changes]
|
|
659
|
-
|
|
660
|
-
> /checkpoint oauth-implementation
|
|
661
|
-
|
|
662
|
-
│ ✓ Checkpoint created: oauth-implementation
|
|
663
|
-
|
|
664
|
-
> /exit
|
|
665
|
-
|
|
666
|
-
# Later, resume the session
|
|
667
|
-
codesavant -r
|
|
668
|
-
|
|
669
|
-
> /resume
|
|
670
|
-
|
|
671
|
-
│ Recent sessions:
|
|
672
|
-
│ 1. [2h ago] OAuth authentication (15 messages)
|
|
673
|
-
│ 2. [1d ago] Bug fix in parser (8 messages)
|
|
674
|
-
│
|
|
675
|
-
│ Which session? (1-2)
|
|
676
|
-
|
|
677
|
-
> 1
|
|
678
|
-
|
|
679
|
-
│ Resuming session...
|
|
680
|
-
│ [Previous conversation restored]
|
|
681
|
-
|
|
682
|
-
> Continue with the OAuth implementation
|
|
683
|
-
```
|
|
684
|
-
|
|
685
|
-
---
|
|
686
|
-
|
|
687
|
-
## 🔐 Security
|
|
532
|
+
## Security
|
|
688
533
|
|
|
689
534
|
CodeSavant includes comprehensive security features:
|
|
690
535
|
|
|
@@ -697,28 +542,15 @@ CodeSavant includes comprehensive security features:
|
|
|
697
542
|
|
|
698
543
|
### Built-in Protections
|
|
699
544
|
|
|
700
|
-
-
|
|
701
|
-
-
|
|
702
|
-
-
|
|
703
|
-
-
|
|
704
|
-
-
|
|
705
|
-
|
|
706
|
-
### Best Practices
|
|
707
|
-
|
|
708
|
-
```bash
|
|
709
|
-
# Use plan mode for exploratory analysis
|
|
710
|
-
codesavant --plan
|
|
711
|
-
|
|
712
|
-
# Review changes before committing
|
|
713
|
-
codesavant # (default mode prompts for destructive ops)
|
|
714
|
-
|
|
715
|
-
# Avoid YOLO mode in production environments
|
|
716
|
-
codesavant --yolo # ⚠️ Use only in safe environments
|
|
717
|
-
```
|
|
545
|
+
- **SSRF Protection** - Blocks private IPs, localhost in WebFetch
|
|
546
|
+
- **Path Validation** - Prevents traversal attacks in file operations
|
|
547
|
+
- **Command Safety** - Array-based command spawning (no shell injection)
|
|
548
|
+
- **Secrets Handling** - API keys from environment/config only
|
|
549
|
+
- **Tool Risk Assessment** - High-risk tools require approval
|
|
718
550
|
|
|
719
551
|
---
|
|
720
552
|
|
|
721
|
-
##
|
|
553
|
+
## Advanced Features
|
|
722
554
|
|
|
723
555
|
### Hooks System
|
|
724
556
|
|
|
@@ -791,42 +623,93 @@ command: git restore src/config.ts
|
|
|
791
623
|
|
|
792
624
|
---
|
|
793
625
|
|
|
794
|
-
##
|
|
626
|
+
## Examples
|
|
795
627
|
|
|
796
|
-
|
|
628
|
+
### Example 1: Autonomous Feature Building
|
|
797
629
|
|
|
798
630
|
```bash
|
|
799
|
-
|
|
631
|
+
codesavant
|
|
800
632
|
|
|
801
|
-
|
|
802
|
-
|
|
633
|
+
> /craft user authentication with JWT
|
|
634
|
+
|
|
635
|
+
│ Starting autonomous craft cycle...
|
|
636
|
+
│
|
|
637
|
+
│ [Research] Spawning 4 parallel research agents...
|
|
638
|
+
│ ✓ Stack research complete
|
|
639
|
+
│ ✓ Architecture research complete
|
|
640
|
+
│ ✓ Security research complete
|
|
641
|
+
│ ✓ Patterns research complete
|
|
803
642
|
│
|
|
804
|
-
│
|
|
805
|
-
│
|
|
806
|
-
│
|
|
807
|
-
│ - Assistant: 20,860 tokens (46%)
|
|
808
|
-
│ - Tools: 3,000 tokens (7%)
|
|
643
|
+
│ [Questioning] I have 2 questions before building:
|
|
644
|
+
│ 1. Do you want refresh token rotation?
|
|
645
|
+
│ 2. Session storage: Redis or in-memory?
|
|
809
646
|
│
|
|
810
|
-
|
|
647
|
+
> Yes to refresh tokens, use Redis
|
|
648
|
+
|
|
649
|
+
│ [Planning] Creating development roadmap...
|
|
650
|
+
│ [Building] Executing 3 plans with atomic commits...
|
|
651
|
+
│ [Verifying] Running quality checks...
|
|
652
|
+
│
|
|
653
|
+
│ ✓ Feature complete: 12 files, 8 commits, all tests passing
|
|
811
654
|
```
|
|
812
655
|
|
|
813
|
-
|
|
656
|
+
### Example 2: TDD Workflow
|
|
814
657
|
|
|
815
658
|
```bash
|
|
816
|
-
|
|
659
|
+
codesavant
|
|
817
660
|
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
│
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
661
|
+
> /craft proof login endpoint
|
|
662
|
+
|
|
663
|
+
│ Starting TDD workflow. Writing failing tests first...
|
|
664
|
+
|
|
665
|
+
[Tool: Write] ✓ Complete
|
|
666
|
+
file: tests/api/login.test.ts
|
|
667
|
+
|
|
668
|
+
│ ✗ 4 tests failing (expected). Now implementing minimal code to pass...
|
|
669
|
+
|
|
670
|
+
[Tool: Write] ✓ Complete
|
|
671
|
+
file: src/api/login.ts
|
|
672
|
+
|
|
673
|
+
│ ✓ All 4 tests passing!
|
|
674
|
+
```
|
|
675
|
+
|
|
676
|
+
### Example 3: Pipe Mode
|
|
677
|
+
|
|
678
|
+
```bash
|
|
679
|
+
# Analyze an error log
|
|
680
|
+
cat error.log | codesavant --pipe -p "analyze this error and suggest a fix"
|
|
681
|
+
|
|
682
|
+
# Review a diff
|
|
683
|
+
git diff | codesavant --pipe -p "review these changes"
|
|
684
|
+
|
|
685
|
+
# Explain code
|
|
686
|
+
cat complex-algorithm.ts | codesavant --pipe -p "explain this algorithm step by step"
|
|
687
|
+
```
|
|
688
|
+
|
|
689
|
+
### Example 4: Session Management
|
|
690
|
+
|
|
691
|
+
```bash
|
|
692
|
+
# Start working on a feature
|
|
693
|
+
codesavant
|
|
694
|
+
|
|
695
|
+
> I need to add OAuth authentication
|
|
696
|
+
|
|
697
|
+
│ Let's plan the OAuth implementation...
|
|
698
|
+
│ [Long conversation with code changes]
|
|
699
|
+
|
|
700
|
+
> /checkpoint oauth-implementation
|
|
701
|
+
|
|
702
|
+
│ ✓ Checkpoint created: oauth-implementation
|
|
703
|
+
|
|
704
|
+
> /exit
|
|
705
|
+
|
|
706
|
+
# Later, resume the session
|
|
707
|
+
codesavant -r
|
|
825
708
|
```
|
|
826
709
|
|
|
827
710
|
---
|
|
828
711
|
|
|
829
|
-
##
|
|
712
|
+
## Troubleshooting
|
|
830
713
|
|
|
831
714
|
### Provider Not Working
|
|
832
715
|
|
|
@@ -845,25 +728,9 @@ codesavant
|
|
|
845
728
|
│ ✓ All systems operational
|
|
846
729
|
```
|
|
847
730
|
|
|
848
|
-
### Session Not Saving
|
|
849
|
-
|
|
850
|
-
```bash
|
|
851
|
-
# Check permissions
|
|
852
|
-
ls -la ~/.codesavant/
|
|
853
|
-
|
|
854
|
-
# Should see:
|
|
855
|
-
# drwxr-xr-x sessions/
|
|
856
|
-
# -rw-r--r-- settings.json
|
|
857
|
-
|
|
858
|
-
# Fix permissions if needed
|
|
859
|
-
chmod 755 ~/.codesavant
|
|
860
|
-
chmod 644 ~/.codesavant/settings.json
|
|
861
|
-
```
|
|
862
|
-
|
|
863
731
|
### API Rate Limits
|
|
864
732
|
|
|
865
733
|
```bash
|
|
866
|
-
# Check cost/usage
|
|
867
734
|
> /cost
|
|
868
735
|
|
|
869
736
|
│ Token Usage (This Session):
|
|
@@ -876,7 +743,7 @@ chmod 644 ~/.codesavant/settings.json
|
|
|
876
743
|
|
|
877
744
|
---
|
|
878
745
|
|
|
879
|
-
##
|
|
746
|
+
## Contributing
|
|
880
747
|
|
|
881
748
|
We welcome contributions! CodeSavant is open source under the MIT license.
|
|
882
749
|
|
|
@@ -906,33 +773,39 @@ bun run build
|
|
|
906
773
|
codesavant/
|
|
907
774
|
├── src/
|
|
908
775
|
│ ├── cli.ts # CLI entry point
|
|
909
|
-
│ ├── repl-ink.tsx
|
|
910
|
-
│ ├── agent.ts
|
|
911
|
-
│ ├── providers/
|
|
912
|
-
│ ├── tools/
|
|
913
|
-
│ ├── skills/
|
|
914
|
-
│ ├──
|
|
776
|
+
│ ├── repl-ink.tsx # Interactive REPL
|
|
777
|
+
│ ├── agent.ts # AI agent orchestration
|
|
778
|
+
│ ├── providers/ # AI provider implementations
|
|
779
|
+
│ ├── tools/ # Built-in tools
|
|
780
|
+
│ ├── skills/ # Unified skill system
|
|
781
|
+
│ ├── craft/ # Craft skill engine
|
|
782
|
+
│ ├── craft-orchestrator/ # Autonomous build cycle
|
|
783
|
+
│ ├── marketplace/ # Skill marketplace
|
|
784
|
+
│ ├── brain/ # Self-improving brain
|
|
785
|
+
│ ├── design/ # Design intelligence
|
|
786
|
+
│ ├── components/ # UI components
|
|
915
787
|
│ └── ...
|
|
916
|
-
├── tests/
|
|
917
|
-
├── docs/
|
|
788
|
+
├── tests/ # Test suite (360+ test files)
|
|
789
|
+
├── docs/ # Documentation
|
|
918
790
|
└── package.json
|
|
919
791
|
```
|
|
920
792
|
|
|
921
793
|
---
|
|
922
794
|
|
|
923
|
-
##
|
|
795
|
+
## License
|
|
924
796
|
|
|
925
797
|
MIT License - see [LICENSE](LICENSE) file for details.
|
|
926
798
|
|
|
927
799
|
---
|
|
928
800
|
|
|
929
|
-
##
|
|
801
|
+
## Acknowledgments
|
|
930
802
|
|
|
931
803
|
Built with:
|
|
932
804
|
- [Bun](https://bun.sh) - Fast JavaScript runtime
|
|
933
805
|
- [Ink](https://github.com/vadimdemedes/ink) - React for CLIs
|
|
934
806
|
- [Commander.js](https://github.com/tj/commander.js) - CLI framework
|
|
935
807
|
- [Chalk](https://github.com/chalk/chalk) - Terminal styling
|
|
808
|
+
- [Zod](https://zod.dev) - TypeScript schema validation
|
|
936
809
|
|
|
937
810
|
Powered by:
|
|
938
811
|
- [Anthropic Claude](https://anthropic.com)
|
|
@@ -943,26 +816,11 @@ Powered by:
|
|
|
943
816
|
|
|
944
817
|
---
|
|
945
818
|
|
|
946
|
-
##
|
|
819
|
+
## Support
|
|
947
820
|
|
|
948
821
|
- **Issues**: [GitHub Issues](https://github.com/vaggarwal039/codesavant/issues)
|
|
949
822
|
- **Discussions**: [GitHub Discussions](https://github.com/vaggarwal039/codesavant/discussions)
|
|
950
|
-
- **Email**: vishal.a.aggarwal@pwc.com
|
|
951
823
|
|
|
952
824
|
---
|
|
953
825
|
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
Coming soon:
|
|
957
|
-
- [ ] Web dashboard for session management
|
|
958
|
-
- [ ] VS Code extension
|
|
959
|
-
- [ ] Custom theme editor
|
|
960
|
-
- [ ] Team collaboration features
|
|
961
|
-
- [ ] Cloud session sync
|
|
962
|
-
- [ ] More AI providers (Cohere, Mistral, etc.)
|
|
963
|
-
|
|
964
|
-
---
|
|
965
|
-
|
|
966
|
-
**Made with ❤️ by Vishal Aggarwal**
|
|
967
|
-
|
|
968
|
-
**Star ⭐ this repo if you find it useful!**
|
|
826
|
+
**Made with care by [Vishal Aggarwal](https://github.com/vaggarwal039)**
|