Kiro CLI provides out-of-the-box code intelligence for 18 languages without requiring any setup. Agents can search symbols, get document symbols, lookup definitions, and perform structural code searches immediately.
For enhanced features like find references, hover documentation, and rename refactoring, you can optionally enable LSP integration.
Bash, C, C++, C#, Elixir, Go, Java, JavaScript, Kotlin, Lua, PHP, Python, Ruby, Rust, Scala, Swift, TSX, TypeScript
Get a quick overview of any workspace:
/code overview
Use --silent for cleaner output:
/code overview --silent
This is useful for:
For enhanced code intelligence features like find references, hover documentation, and rename refactoring, you can enable LSP integration.
Kiro CLI spawns LSP server processes in the background that communicate via JSON-RPC over stdio. When you initialize a workspace, it detects languages from project markers (like package.json, Cargo.toml) and
file extensions, then starts the appropriate language servers. These servers continuously analyze your code and maintain an index of symbols, types, and references. When you make queries, Kiro translates your
natural language into LSP protocol requests, sends them to the relevant server, and formats the responses back into readable output.
Here's how you can enable Kiro CLI to use LSP servers:
Default LSP configurations are included for: C/C++, Go, Java, Kotlin, Python, Ruby, Rust, TypeScript/JavaScript
Supported Languages
| Language | Extensions | Server | Install Command |
|---|---|---|---|
| TypeScript/JavaScript | .ts, .js, .tsx, .jsx | typescript-language-server | npm install -g typescript-language-server typescript |
| Rust | .rs | rust-analyzer | rustup component add rust-analyzer |
| Python | .py | jedi-language-server | npm install -g pyright or pip install pyright |
| Go | .go | gopls | go install golang.org/x/tools/gopls@latest |
| Java | .java | jdtls | brew install jdtls (macOS) |
| Ruby | .rb | solargraph | gem install solargraph |
| C/C++ | .c, .cpp, .h, .hpp | clangd | brew install llvm (macOS) or apt install clangd (Linux) |
Run this slash command in your project root:
/code init
This creates .kiro/settings/lsp.json configuration and starts language servers.
What you'll see:
✓ Workspace initialization started Workspace: /path/to/your/project Detected Languages: ["python", "rust", "typescript"] Project Markers: ["Cargo.toml", "package.json"] Available LSPs: ○ clangd (cpp) - available ○ gopls (go) - not installed ◐ jdtls (java) - initializing... ✓ jedi-language-server (python) - initialized (687ms) ✓ rust-analyzer (rust) - initialized (488ms) ○ solargraph (ruby) - not installed ✓ typescript-language-server (typescript) - initialized (214ms)
Status indicators:
Restart LSP servers: If language servers shut down or become unresponsive, use /code init -f.
Auto-initialization: After the first /code init, Kiro CLI automatically initializes code intelligence on startup when .kiro/settings/lsp.json exists in the workspace.
Disabling code intelligence: Delete .kiro/settings/lsp.json from your project to disable. You must restart your session for this change to take effect. Re-enable anytime with /code init.
Language servers provide semantic code intelligence through natural language queries. You can search symbols, navigate definitions, find references, rename across files, get diagnostics, view method documentation, and discover available APIs on classes and objects.
Find a symbol:
> Find the UserRepository class Searching for symbols matching: "UserRepository" 1. Class UserRepository at src/repositories/user.repository.ts:15:1
Find all references:
> Find references of Person class Finding all references at: auth.ts:42:10 1. src/auth.ts:42:10 - export function authenticate(...) 2. src/handlers/login.ts:15:5 - authenticate(credentials) 3. src/handlers/api.ts:89:12 - await authenticate(token)
Go to definition:
> Find the definition of UserService src/services/user.service.ts:42:1: export class UserService { ...
Get file symbols:
> What symbols are in auth.service.ts? Getting symbols from: auth.service.ts 1. Class AuthService at auth.service.ts:12:1 2. Function login at auth.service.ts:25:3 3. Function logout at auth.service.ts:45:3 4. Function validateToken at auth.service.ts:62:3
Rename with dry run:
> Dry run: rename the method "FetchUser" to "fetchUserData" Dry run: Would rename 12 occurrences in 5 files
Get diagnostics:
> Get diagnostics for main.ts 1. Error line 15:10: Cannot find name 'undefined_var' 2. Warning line 42:5: 'result' is declared but never used
Get hover documentation:
> What's the documentation for the authenticate method in AuthService? Type: (credentials: Credentials) => Promise<AuthResult> Documentation: Authenticates a user with the provided credentials. Returns an AuthResult containing the user token and profile. @param credentials - User login credentials @throws AuthenticationError if credentials are invalid
Discover available methods:
> What methods are available on the s3Client instance? Available completions: 1. putObject - Function: (params: PutObjectRequest) => Promise<PutObjectOutput> 2. getObject - Function: (params: GetObjectRequest) => Promise<GetObjectOutput> 3. deleteObject - Function: (params: DeleteObjectRequest) => Promise<DeleteObjectOutput> 4. listObjects - Function: (params: ListObjectsRequest) => Promise<ListObjectsOutput> 5. headObject - Function: (params: HeadObjectRequest) => Promise<HeadObjectOutput>
Add custom language servers by editing .kiro/settings/lsp.json in your project:
{ "languages": { "mylang": { "name": "my-language-server", "command": "my-lsp-binary", "args": ["--stdio"], "file_extensions": ["mylang", "ml"], "project_patterns": ["mylang.config"], "exclude_patterns": ["**/build/**"], "multi_workspace": false, "initialization_options": { "custom": "options" } } } }
Fields:
After editing, restart KIRO CLI to load the new configuration.
| Issue | Cause(s) | Solution |
|---|---|---|
| Workspace is still initializing | LSP servers are starting up | Wait and try again. If servers crashed, use /code init -f to restart. |
| LSP initialization failed | Check logs for details: /code logs -l | |
| No symbols found | Language server is still indexing or File has syntax errors or Symbol name doesn't match | Check file for errors, try broader search terms. |
| No definition found | Position doesn't point to a symbol. Solution: Verify the row and column numbers point to a symbol name. |
/code init in project root
Code Intelligence