@ridit/lens 0.4.0 → 0.4.2

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 ADDED
@@ -0,0 +1,97 @@
1
+ # Lens
2
+
3
+ Lens is an AI-powered CLI tool that lets you explore, understand, and modify any codebase through natural language. Built with React and Ink for a rich terminal UI, Lens connects to multiple LLM providers and gives the AI direct access to your filesystem, shell, and the web.
4
+
5
+ ## Features
6
+
7
+ - **Chat with your codebase** — ask questions, request changes, scaffold new files
8
+ - **Multi-provider support** — Anthropic, OpenAI, Gemini, Ollama, or any OpenAI-compatible API
9
+ - **Tool system** — AI can read/write files, run shell commands, fetch URLs, search the web, clone repos, generate PDFs, and more
10
+ - **Plugin registry** — extend Lens with custom tools via `@ridit/lens-sdk`
11
+ - **Diff preview** — proposed code changes are shown as a diff before applying
12
+ - **Auto-approve mode** — `/auto` skips confirmation for safe read/search tools
13
+ - **Force-all mode** — `/auto --force-all` approves everything including shell and writes
14
+ - **Persistent memory** — Lens remembers project-specific context across sessions
15
+ - **Chat history** — save, load, rename, and delete chat sessions per repo
16
+ - **Smart commits** — generate conventional commit messages from staged changes
17
+ - **Timeline** — browse and explore commit history
18
+ - **Repo analysis** — deep codebase review from a remote URL or local path
19
+
20
+ ## Installation
21
+
22
+ ```bash
23
+ # using bun
24
+ bun add @ridit/lens -g
25
+
26
+ # using npm
27
+ npm install -g @ridit/lens
28
+ ```
29
+
30
+ ## CLI Commands
31
+
32
+ ### Available
33
+
34
+ ```
35
+ lens open interactive chat (default)
36
+ lens chat chat with your codebase
37
+ lens chat -p /path/to/repo chat in a specific repo
38
+ lens chat --session <id> resume or create a session by ID
39
+ lens chat --prompt <text> send a single prompt non-interactively
40
+ lens chat --dev output structured JSON (for SDK/tooling use)
41
+ lens chat --single run one message then exit, resumes latest session
42
+ lens chat --force-all auto-approve all tools including writes and shell
43
+ lens chat --dev --prompt <text> headless mode: JSON output, no UI
44
+
45
+ lens provider configure AI providers (interactive)
46
+ lens provider --list list configured providers
47
+ lens provider --provider <name> --model <model> --api-key <key> add/update a provider
48
+ lens provider --switch <name> switch the active provider
49
+ lens provider --remove <name> remove a provider
50
+ lens provider --dev output result as JSON
51
+
52
+ lens task <text> apply a natural language change to the codebase
53
+ lens commit generate a smart commit message from staged changes
54
+ lens commit --auto stage all and commit without confirmation
55
+ lens commit --push push to remote after committing
56
+ ```
57
+
58
+ ### Work in progress
59
+
60
+ The following commands existed in a previous version of Lens and are being restored after a core rewrite. They are registered but not fully functional yet:
61
+
62
+ ```
63
+ lens review AI review of the codebase (coming soon)
64
+ lens repo <url> analyze a remote repository (coming soon)
65
+ lens timeline explore commit history (coming soon)
66
+ lens run <cmd> run dev server, auto-fix errors (coming soon)
67
+ ```
68
+
69
+ ## Chat Commands
70
+
71
+ Once inside a `lens chat` session, use slash commands:
72
+
73
+ ```
74
+ /auto toggle auto-approve for safe tools (read, search, fetch)
75
+ /auto --force-all auto-approve ALL tools including shell and writes ⚠️
76
+ /provider configure AI provider without leaving chat
77
+ /memory list list stored memories for this repo
78
+ /memory add <text> add a memory
79
+ /memory clear clear all memories for this repo
80
+ /clear history wipe session memory for this repo
81
+ ```
82
+
83
+ ## Supported Providers
84
+
85
+ - **Anthropic** — Claude models
86
+ - **OpenAI** — GPT models
87
+ - **Gemini** — Google Gemini models
88
+ - **Ollama** — local models (free, fully offline)
89
+ - **Custom** — any OpenAI-compatible API endpoint
90
+
91
+ ## Extending Lens
92
+
93
+ Custom tools can be built and registered using [`@ridit/lens-sdk`](https://www.npmjs.com/package/@ridit/lens-sdk).
94
+
95
+ ## License
96
+
97
+ MIT
package/dist/index.mjs CHANGED
@@ -108867,8 +108867,9 @@ function ChatRunner({
108867
108867
  color: ACCENT,
108868
108868
  children: "●"
108869
108869
  }, undefined, false, undefined, this),
108870
- /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(MessageBody, {
108871
- content: currentChunk
108870
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
108871
+ wrap: "wrap",
108872
+ children: currentChunk
108872
108873
  }, undefined, false, undefined, this)
108873
108874
  ]
108874
108875
  }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(jsx_dev_runtime14.Fragment, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ridit/lens",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "Understand your codebase.",
5
5
  "author": "Ridit Jangra <riditjangra09@gmail.com> (https://ridit.space)",
6
6
  "license": "MIT",
@@ -20,8 +20,6 @@
20
20
  "test": "bun test"
21
21
  },
22
22
  "dependencies": {
23
- "@ridit/ink-ui": "*",
24
- "@ridit/lens-core": "*",
25
23
  "chalk": "^5.6.2",
26
24
  "commander": "^14.0.3",
27
25
  "figures": "^6.1.0",
@@ -32,8 +30,7 @@
32
30
  },
33
31
  "devDependencies": {
34
32
  "@types/react": "^18.0.0",
35
- "@types/bun": "latest",
36
- "@ridit/typescript-config": "*"
33
+ "@types/bun": "latest"
37
34
  },
38
35
  "peerDependencies": {
39
36
  "typescript": "^5"
@@ -3,7 +3,6 @@ import { Box, Text, Static, useInput } from "ink";
3
3
  import { ACCENT, GREEN, RED } from "../../colors";
4
4
  import { AppHeader, InputBox, ShortcutBar, TypewriterText } from "./StatusBar";
5
5
  import { StaticMessage } from "./Message";
6
- import { MessageBody } from "@ridit/ink-ui";
7
6
  import type { UIMessage } from "./Message";
8
7
  import { ProviderSetup } from "../provider/ProviderSetup";
9
8
  import {
@@ -455,7 +454,7 @@ export function ChatRunner({
455
454
  {currentChunk ? (
456
455
  <Box gap={1}>
457
456
  <Text color={ACCENT}>●</Text>
458
- <MessageBody content={currentChunk} />
457
+ <Text wrap="wrap">{currentChunk}</Text>
459
458
  </Box>
460
459
  ) : (
461
460
  <>