这是indexloc提供的服务,不要输入任何密码
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 43 additions & 6 deletions hlyr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,24 +199,61 @@ humanlayer thoughts <subcommand>
- `sync` - Manually sync thoughts and update searchable index
- `status` - Check the status of your thoughts setup
- `config` - View or edit thoughts configuration
- `uninit` - Remove thoughts setup from current repository
- `profile` - Manage thoughts profiles (for multiple thoughts repositories)

**Profile Management:**

The thoughts system supports multiple profiles, allowing you to maintain separate thoughts repositories for different organizational contexts (e.g., personal projects, different clients).

```bash
# Create a new profile
humanlayer thoughts profile create <name> [--repo <path>] [--repos-dir <name>] [--global-dir <name>]

# List all profiles
humanlayer thoughts profile list [--json]

# Show profile details
humanlayer thoughts profile show <name> [--json]

# Delete a profile
humanlayer thoughts profile delete <name> [--force]
```

**Examples:**

```bash
# Initialize thoughts for a new project
# Initialize thoughts for a new project (default profile)
humanlayer thoughts init

# Sync thoughts after making changes
# Create a profile for personal projects
humanlayer thoughts profile create personal --repo ~/thoughts-personal

# Initialize a repo with a specific profile
cd ~/projects/personal-app
humanlayer thoughts init --profile personal

# Sync thoughts (automatically uses the correct profile's repository)
humanlayer thoughts sync -m "Updated architecture notes"

# Check status
# Check status (shows which profile is active)
humanlayer thoughts status

# View configuration
humanlayer thoughts config --json
# View all profiles and configuration
humanlayer thoughts config

# List all configured profiles
humanlayer thoughts profile list
```

The thoughts system keeps your notes separate from code while making them easily accessible to AI assistants. See the [Thoughts documentation](./THOUGHTS.md) for detailed information.
**Profile Features:**

- **Multiple Repositories**: Each profile can have its own thoughts repository location
- **Automatic Resolution**: Commands automatically use the correct profile based on repository mappings
- **Backward Compatible**: Existing configurations without profiles continue to work unchanged
- **Per-Repository Profiles**: Different repositories can use different profiles, even worktrees of the same repo

The thoughts system keeps your notes separate from code while making them easily accessible to AI assistants.

### `claude`

Expand Down
38 changes: 38 additions & 0 deletions hlyr/src/commands/thoughts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import { thoughtsUninitCommand } from './thoughts/uninit.js'
import { thoughtsSyncCommand } from './thoughts/sync.js'
import { thoughtsStatusCommand } from './thoughts/status.js'
import { thoughtsConfigCommand } from './thoughts/config.js'
import { profileCreateCommand } from './thoughts/profile/create.js'
import { profileListCommand } from './thoughts/profile/list.js'
import { profileShowCommand } from './thoughts/profile/show.js'
import { profileDeleteCommand } from './thoughts/profile/delete.js'

export function thoughtsCommand(program: Command): void {
const thoughts = program.command('thoughts').description('Manage developer thoughts and notes')
Expand All @@ -14,6 +18,7 @@ export function thoughtsCommand(program: Command): void {
.option('--force', 'Force reconfiguration even if already set up')
.option('--config-file <path>', 'Path to config file')
.option('--directory <name>', 'Specify the repository directory name (skips interactive prompt)')
.option('--profile <name>', 'Use a specific thoughts profile')
.action(thoughtsInitCommand)

thoughts
Expand Down Expand Up @@ -43,4 +48,37 @@ export function thoughtsCommand(program: Command): void {
.option('--json', 'Output configuration as JSON')
.option('--config-file <path>', 'Path to config file')
.action(thoughtsConfigCommand)

// Profile management commands
const profile = thoughts.command('profile').description('Manage thoughts profiles')

profile
.command('create <name>')
.description('Create a new thoughts profile')
.option('--repo <path>', 'Thoughts repository path')
.option('--repos-dir <name>', 'Repos directory name')
.option('--global-dir <name>', 'Global directory name')
.option('--config-file <path>', 'Path to config file')
.action(profileCreateCommand)

profile
.command('list')
.description('List all thoughts profiles')
.option('--json', 'Output as JSON')
.option('--config-file <path>', 'Path to config file')
.action(profileListCommand)

profile
.command('show <name>')
.description('Show details of a specific profile')
.option('--json', 'Output as JSON')
.option('--config-file <path>', 'Path to config file')
.action(profileShowCommand)

profile
.command('delete <name>')
.description('Delete a thoughts profile')
.option('--force', 'Force deletion even if in use')
.option('--config-file <path>', 'Path to config file')
.action(profileDeleteCommand)
}
31 changes: 28 additions & 3 deletions hlyr/src/commands/thoughts/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { spawn } from 'child_process'
import chalk from 'chalk'
import { loadThoughtsConfig } from '../../thoughtsConfig.js'
import {
loadThoughtsConfig,
getRepoNameFromMapping,
getProfileNameFromMapping,
} from '../../thoughtsConfig.js'
import { getDefaultConfigPath } from '../../config.js'

interface ConfigOptions {
Expand Down Expand Up @@ -54,9 +58,30 @@ export async function thoughtsConfigCommand(options: ConfigOptions): Promise<voi
if (mappings.length === 0) {
console.log(chalk.gray(' No repositories mapped yet'))
} else {
mappings.forEach(([repo, thoughtsDir]) => {
mappings.forEach(([repo, mapping]) => {
const repoName = getRepoNameFromMapping(mapping)
const profileName = getProfileNameFromMapping(mapping)

console.log(` ${chalk.cyan(repo)}`)
console.log(` → ${chalk.green(`${config.reposDir}/${thoughtsDir}`)}`)
console.log(` → ${chalk.green(`${config.reposDir}/${repoName}`)}`)

if (profileName) {
console.log(` Profile: ${chalk.yellow(profileName)}`)
} else {
console.log(` Profile: ${chalk.gray('(default)')}`)
}
})
}

console.log('')

// Add profiles section
console.log(chalk.yellow('Profiles:'))
if (!config.profiles || Object.keys(config.profiles).length === 0) {
console.log(chalk.gray(' No profiles configured'))
} else {
Object.keys(config.profiles).forEach(name => {
console.log(` ${chalk.cyan(name)}`)
})
}

Expand Down
Loading