@our2ndbrain/cli 1.1.3
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/.obsidian/.2ndbrain-manifest.json +8 -0
- package/.obsidian/app.json +6 -0
- package/.obsidian/appearance.json +1 -0
- package/.obsidian/community-plugins.json +4 -0
- package/.obsidian/core-plugins.json +33 -0
- package/.obsidian/graph.json +22 -0
- package/.obsidian/plugins/calendar/data.json +10 -0
- package/.obsidian/plugins/calendar/main.js +4459 -0
- package/.obsidian/plugins/calendar/manifest.json +10 -0
- package/.obsidian/plugins/obsidian-custom-attachment-location/data.json +32 -0
- package/.obsidian/plugins/obsidian-custom-attachment-location/main.js +575 -0
- package/.obsidian/plugins/obsidian-custom-attachment-location/manifest.json +11 -0
- package/.obsidian/plugins/obsidian-custom-attachment-location/styles.css +1 -0
- package/.obsidian/plugins/obsidian-git/data.json +62 -0
- package/.obsidian/plugins/obsidian-git/main.js +426 -0
- package/.obsidian/plugins/obsidian-git/manifest.json +10 -0
- package/.obsidian/plugins/obsidian-git/obsidian_askpass.sh +23 -0
- package/.obsidian/plugins/obsidian-git/styles.css +629 -0
- package/.obsidian/plugins/obsidian-tasks-plugin/main.js +504 -0
- package/.obsidian/plugins/obsidian-tasks-plugin/manifest.json +12 -0
- package/.obsidian/plugins/obsidian-tasks-plugin/styles.css +1 -0
- package/.obsidian/types.json +28 -0
- package/00_Dashboard/01_All_Tasks.md +118 -0
- package/00_Dashboard/09_All_Done.md +42 -0
- package/10_Inbox/Agents/Journal.md +1 -0
- package/99_System/Scripts/init_member.sh +108 -0
- package/99_System/Templates/tpl_daily_note.md +13 -0
- package/99_System/Templates/tpl_member_done.md +32 -0
- package/99_System/Templates/tpl_member_tasks.md +97 -0
- package/AGENTS.md +193 -0
- package/CHANGELOG.md +67 -0
- package/CLAUDE.md +153 -0
- package/LICENSE +201 -0
- package/README.md +636 -0
- package/bin/2ndbrain.js +117 -0
- package/package.json +56 -0
- package/src/commands/completion.js +198 -0
- package/src/commands/init.js +308 -0
- package/src/commands/member.js +123 -0
- package/src/commands/remove.js +88 -0
- package/src/commands/update.js +507 -0
- package/src/index.js +17 -0
- package/src/lib/config.js +112 -0
- package/src/lib/diff.js +222 -0
- package/src/lib/files.js +340 -0
- package/src/lib/obsidian.js +366 -0
- package/src/lib/prompt.js +182 -0
package/AGENTS.md
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
# AGENTS.md
|
|
2
|
+
|
|
3
|
+
> This is the project guide for AI assistants. When helping users operate this project, please follow these rules.
|
|
4
|
+
|
|
5
|
+
## Installing 2ndBrain CLI
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Use npx to run directly (recommended)
|
|
9
|
+
npx @our2ndbrain/cli@latest <command>
|
|
10
|
+
|
|
11
|
+
# Or install globally
|
|
12
|
+
npm install -g @our2ndbrain/cli
|
|
13
|
+
2ndbrain <command>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Project Overview
|
|
17
|
+
|
|
18
|
+
**2ndBrain** is a personal knowledge management system based on PARA + C-O-R-D + Append-and-Review, using Obsidian as the frontend tool.
|
|
19
|
+
|
|
20
|
+
## Directory Structure Conventions
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
2ndBrain/
|
|
24
|
+
├── 00_Dashboard/ # Dashboards: task aggregation entry point
|
|
25
|
+
├── 10_Inbox/ # Inbox: journals land here
|
|
26
|
+
│ └── {MemberName}/ # One subdirectory per member
|
|
27
|
+
├── 20_Areas/ # Areas: long-term focus areas
|
|
28
|
+
├── 30_Projects/ # Projects: things with clear goals
|
|
29
|
+
├── 40_Resources/ # Resources: reference materials
|
|
30
|
+
├── 90_Archives/ # Archives: completed or inactive items
|
|
31
|
+
└── 99_System/ # System: templates, scripts and config
|
|
32
|
+
├── Scripts/ # Automation scripts
|
|
33
|
+
└── Templates/ # Note templates
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Core Rules
|
|
37
|
+
|
|
38
|
+
### 1. Task Format
|
|
39
|
+
|
|
40
|
+
All tasks use Markdown checkbox format:
|
|
41
|
+
|
|
42
|
+
```markdown
|
|
43
|
+
- [ ] Task description #tag 📅 2026-01-15
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### 2. Tag Conventions
|
|
47
|
+
|
|
48
|
+
| Tag | Purpose |
|
|
49
|
+
|-----|---------|
|
|
50
|
+
| `#next` | Next task to do |
|
|
51
|
+
| `#waiting` | Waiting on others |
|
|
52
|
+
| `#someday` | Later task |
|
|
53
|
+
| `#read` / `#watch` / `#listen` | Read/watch/listen lists |
|
|
54
|
+
| `📅 YYYY-MM-DD` | Due date |
|
|
55
|
+
|
|
56
|
+
### 3. Journal Heading Structure
|
|
57
|
+
|
|
58
|
+
Use the following headings in journals to categorize content. Dashboards will auto-recognize them:
|
|
59
|
+
|
|
60
|
+
- `## 💼 Works` - Work tasks
|
|
61
|
+
- `## 💡 Thoughts` - Ideas and inspirations
|
|
62
|
+
- `## 📚 Readings` - Reading list
|
|
63
|
+
|
|
64
|
+
### 4. File Placement Rules
|
|
65
|
+
|
|
66
|
+
- **All new content** → First put in journals under `10_Inbox/{member}/`
|
|
67
|
+
- **Clear goals** → `30_Projects/`
|
|
68
|
+
- **Long-term maintenance** → `20_Areas/`
|
|
69
|
+
- **Reference materials** → `40_Resources/`
|
|
70
|
+
- **No longer active** → `90_Archives/`
|
|
71
|
+
|
|
72
|
+
## Common Operations
|
|
73
|
+
|
|
74
|
+
### Creating a New Member
|
|
75
|
+
|
|
76
|
+
Use CLI command:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
npx @our2ndbrain/cli@latest member {MemberName}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
This creates:
|
|
83
|
+
- `10_Inbox/{MemberName}/01_Tasks.md` - Personal task dashboard
|
|
84
|
+
- `10_Inbox/{MemberName}/09_Done.md` - Personal completion record
|
|
85
|
+
- `.obsidian/daily-notes.json` - Configures journal to save to that member directory
|
|
86
|
+
|
|
87
|
+
> 💡 Use `--no-config` option for team collaboration to avoid overwriting other members' config.
|
|
88
|
+
|
|
89
|
+
## AI Assistant Notes
|
|
90
|
+
|
|
91
|
+
1. **Don't modify Dataview queries in dashboard files**
|
|
92
|
+
- Global dashboards: `00_Dashboard/01_All_Tasks.md` and `09_All_Done.md`
|
|
93
|
+
- Personal dashboards: `10_Inbox/{member}/01_Tasks.md` and `09_Done.md`
|
|
94
|
+
- These are auto-generated dashboards. Only modify tasks in journals, dashboards will auto-update.
|
|
95
|
+
|
|
96
|
+
2. **Use template when creating journals**
|
|
97
|
+
- Template located at `99_System/Templates/tpl_daily_note.md`
|
|
98
|
+
- Journal naming format: `YYYY-MM-DD.md`
|
|
99
|
+
|
|
100
|
+
3. **After task completion**
|
|
101
|
+
- Change `- [ ]` to `- [x]`
|
|
102
|
+
- Tasks plugin will auto-add completion date `✅ YYYY-MM-DD`
|
|
103
|
+
|
|
104
|
+
4. **Follow user's language preference**
|
|
105
|
+
- Adapt responses to user's language settings
|
|
106
|
+
- Match the language used in the conversation
|
|
107
|
+
|
|
108
|
+
## Agent Collaboration Design
|
|
109
|
+
|
|
110
|
+
AI assistants and humans **coexist collaboratively** in 2ndBrain. Agents can directly operate all directories (`20_Areas/`, `30_Projects/`, `40_Resources/`, etc.), only need a shared workspace to record work logs.
|
|
111
|
+
|
|
112
|
+
### Shared Workspace
|
|
113
|
+
|
|
114
|
+
All Agents share the `10_Inbox/Agents/` directory (note: plural), using a single-file Journal mode:
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
10_Inbox/Agents/
|
|
118
|
+
└── Journal.md # All Agents' work logs (append-and-review)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Journal Format
|
|
122
|
+
|
|
123
|
+
Uses **append-and-review** mode:
|
|
124
|
+
- **Append**: New content appended to file end, separated by delimiters per entry
|
|
125
|
+
- **Review**: Periodically review TODOs, check off when complete; valuable content can be output to other directories
|
|
126
|
+
|
|
127
|
+
```markdown
|
|
128
|
+
# Agent Journal
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
2026-01-14 15:30 | Cursor
|
|
132
|
+
|
|
133
|
+
Executed xxx task...
|
|
134
|
+
|
|
135
|
+
- [ ] Discovered issue #next
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
2026-01-14 16:45 | Claude Desktop
|
|
139
|
+
|
|
140
|
+
Optimized yyy...
|
|
141
|
+
|
|
142
|
+
## 💡 Improvement Suggestions
|
|
143
|
+
|
|
144
|
+
- Suggest zzz
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Why This Design?
|
|
148
|
+
|
|
149
|
+
| Feature | Reason |
|
|
150
|
+
|---------|--------|
|
|
151
|
+
| **Shared directory** | Agents aren't "people", don't need isolated personal spaces |
|
|
152
|
+
| **Single file** | Read once for full context, highest efficiency |
|
|
153
|
+
| **Append-and-Review** | Simple writing + periodic organization, follows C-O-R-D workflow |
|
|
154
|
+
| **Timestamp + Agent name** | Know who did what when |
|
|
155
|
+
|
|
156
|
+
### Review Workflow
|
|
157
|
+
|
|
158
|
+
Journal content can be output to other directories during review:
|
|
159
|
+
|
|
160
|
+
| Content Type | Output Target |
|
|
161
|
+
|-------------|---------------|
|
|
162
|
+
| Completed TODOs | Check off `[x]` stay in place |
|
|
163
|
+
| Discovered issues/solutions | → `30_Projects/` related projects |
|
|
164
|
+
| Reusable experience | → `40_Resources/` or `20_Areas/` |
|
|
165
|
+
| Error post-mortem | Keep in Journal as history |
|
|
166
|
+
|
|
167
|
+
### When to Write Journal
|
|
168
|
+
|
|
169
|
+
- After executing complex tasks (migration, refactoring, batch modifications)
|
|
170
|
+
- When discovering issues that need fixing
|
|
171
|
+
- When having improvement suggestions
|
|
172
|
+
- When encountering failures or anomalies
|
|
173
|
+
|
|
174
|
+
### Work Principles
|
|
175
|
+
|
|
176
|
+
1. **Prefer improving tools over bypassing them** - Manual operations are non-reproducible and error-prone. When encountering scenarios not supported by tools, improve the tool first then execute.
|
|
177
|
+
2. **Pay attention to naming consistency** - Tool design should consider naming differences to avoid sync failures due to inconsistent naming.
|
|
178
|
+
|
|
179
|
+
### Tasks in Journal
|
|
180
|
+
|
|
181
|
+
Agents can write todo tasks in Journal, Dashboard dashboards will auto-recognize:
|
|
182
|
+
|
|
183
|
+
```markdown
|
|
184
|
+
- [ ] Discovered xxx needs fixing #next
|
|
185
|
+
- [ ] Suggest adding yyy feature #someday 📅 2026-01-30
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
> 💡 **Note**: Tasks with `#someday` tag will appear in "Future Plans" section, regardless of whether they have a due date. This is the dedicated area for "later" tasks.
|
|
189
|
+
|
|
190
|
+
## Reference Links
|
|
191
|
+
|
|
192
|
+
- [README.md](README.md) - Complete project documentation
|
|
193
|
+
- [Template repository](https://github.com/Our2ndBrain/2ndBrain-Template) - Open source template
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [1.1.3] - 2026-01-18
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- reorder Next Actions before Future Plans in dashboard
|
|
12
|
+
|
|
13
|
+
## [1.1.2] - 2026-01-18
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
- improve member dashboard update reliability and fix query syntax
|
|
17
|
+
|
|
18
|
+
## [1.1.1] - 2026-01-18
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
- Fixed Tasks query syntax error in dashboard (changed `has due date due after today` to `due after today`)
|
|
22
|
+
- Added .gitignore rules for temporary scripts in root directory
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
- Synchronized README_en.md with README.md (added integration mode, Obsidian installation guide)
|
|
26
|
+
- Added missing `-y, --yes` option to both README files
|
|
27
|
+
|
|
28
|
+
## [1.1.0] - 2026-01-18
|
|
29
|
+
|
|
30
|
+
### Added
|
|
31
|
+
- add --reset-obsidian option to init command
|
|
32
|
+
|
|
33
|
+
## [1.0.0] - 2026-01-18
|
|
34
|
+
|
|
35
|
+
### Major Release - 2ndBrain CLI
|
|
36
|
+
|
|
37
|
+
A personal knowledge management system CLI tool combining PARA, C-O-R-D, and Append-and-Review methodologies.
|
|
38
|
+
|
|
39
|
+
### Added
|
|
40
|
+
- **Changelog automation**: Automatic changelog generation from git commits via version.js
|
|
41
|
+
- **Interactive diff preview**: Colored unified diff output in update command
|
|
42
|
+
- **Smart file comparison**: Binary/large file detection using diff package
|
|
43
|
+
- **Interactive prompts**: User confirmation system for updates
|
|
44
|
+
- **Smart Obsidian merging**: Plugin manifest support for .obsidian directory
|
|
45
|
+
- **Shell completion**: bash, zsh, fish support via `completion` command
|
|
46
|
+
- **Member management**: Team member initialization with auto-updated dashboards
|
|
47
|
+
- **AI assistant integration**: CLAUDE.md for Claude Code guidance
|
|
48
|
+
- **Pre-configured plugins**: Recommended Obsidian plugins bundled
|
|
49
|
+
|
|
50
|
+
### Changed
|
|
51
|
+
- **Major refactor**: Enhanced update command with diff preview and review
|
|
52
|
+
- **Framework files**: CHANGELOG.md and CLAUDE.md now sync with updates
|
|
53
|
+
- **Documentation strategy**: README.md is Chinese-primary, English in README_en.md
|
|
54
|
+
- **Plugin documentation**: Restructured as required/optional lists
|
|
55
|
+
- **Package distribution**: Fixed npm packaging for all template files
|
|
56
|
+
|
|
57
|
+
### Fixed
|
|
58
|
+
- Changelog generation idempotency (no duplicate versions)
|
|
59
|
+
- Empty version entries in changelog generation
|
|
60
|
+
- Package.json bin and repository URL formats
|
|
61
|
+
- Task query syntax for #someday tag handling
|
|
62
|
+
- Bash completion EPIPE error handling
|
|
63
|
+
|
|
64
|
+
### Removed
|
|
65
|
+
- Bundled dataview plugin (now community plugin)
|
|
66
|
+
- README_zh.md (consolidated into README.md)
|
|
67
|
+
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
**2ndBrain** is a personal knowledge management system CLI tool published as `@our2ndbrain/cli`. It combines three methodologies:
|
|
8
|
+
- **PARA**: Projects, Areas, Resources, Archives organizational structure
|
|
9
|
+
- **C-O-R-D**: Collect → Organize → Review → Do workflow
|
|
10
|
+
- **Append-and-Review**: Karpathy's note-taking approach (append first, organize during review)
|
|
11
|
+
|
|
12
|
+
The CLI provides an Obsidian-based template with a Node.js CLI tool for setup and management. The tool is designed for both individual and team use, with Git integration for synchronization.
|
|
13
|
+
|
|
14
|
+
## CLI Commands
|
|
15
|
+
|
|
16
|
+
### Installation and Usage
|
|
17
|
+
```bash
|
|
18
|
+
# Use npx directly (recommended)
|
|
19
|
+
npx @our2ndbrain/cli@latest <command>
|
|
20
|
+
|
|
21
|
+
# Or install globally
|
|
22
|
+
npm install -g @our2ndbrain/cli
|
|
23
|
+
2ndbrain <command>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Available Commands
|
|
27
|
+
- `2ndbrain init [path]` - Initialize new project from template
|
|
28
|
+
- `2ndbrain member <name> [path]` - Add new member directory
|
|
29
|
+
- `2ndbrain update [path]` - Update framework files with diff preview
|
|
30
|
+
- `2ndbrain remove [path]` - Remove framework files
|
|
31
|
+
|
|
32
|
+
### Command Options
|
|
33
|
+
**init**: `-f, --force` (overwrite), `-t, --template <path>` (custom template)
|
|
34
|
+
**member**: `-f, --force` (overwrite), `--no-config` (skip Obsidian config)
|
|
35
|
+
**update**: `-d, --dry-run` (preview), `-t, --template <path>` (custom template)
|
|
36
|
+
**remove**: `-d, --dry-run` (preview), `-f, --force` (skip confirmation)
|
|
37
|
+
|
|
38
|
+
### Publishing
|
|
39
|
+
```bash
|
|
40
|
+
npm version <major|minor|patch> # Updates CHANGELOG.md via scripts/version.js
|
|
41
|
+
# postversion hook runs: git push && git push --tags && npm publish
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Architecture
|
|
45
|
+
|
|
46
|
+
### Entry Points
|
|
47
|
+
- `bin/2ndbrain.js` - CLI entry point (Commander.js)
|
|
48
|
+
- `src/index.js` - Main module that exports commands
|
|
49
|
+
|
|
50
|
+
### Core Modules
|
|
51
|
+
|
|
52
|
+
**src/lib/config.js** - Framework file definitions
|
|
53
|
+
- `FRAMEWORK_FILES`: Files managed by init/update/remove (AGENTS.md, README.md, CHANGELOG.md, CLAUDE.md, dashboards, templates)
|
|
54
|
+
- `FRAMEWORK_DIRS`: Directories created during init (00_Dashboard, 10_Inbox/Agents, 99_System)
|
|
55
|
+
- `USER_DATA_DIRS`: Never touched by CLI (20_Areas, 30_Projects, 40_Resources, 90_Archives)
|
|
56
|
+
- `COPY_DIRS`: Directories copied entirely (e.g., .obsidian with plugins)
|
|
57
|
+
- `MARKER_FILE`: `AGENTS.md` - identifies a 2ndBrain project
|
|
58
|
+
|
|
59
|
+
**src/lib/files.js** - File operations
|
|
60
|
+
- `copyFiles()` - Basic file copying
|
|
61
|
+
- `copyFilesSmart()` - Copy with comparison, dry-run support, change tracking
|
|
62
|
+
- `removeFiles()` - File removal with tracking
|
|
63
|
+
- `ensureDirs()` / `removeEmptyDirs()` - Directory management
|
|
64
|
+
|
|
65
|
+
**src/lib/diff.js** - File comparison utilities
|
|
66
|
+
- Uses `diff` npm package for line/word comparison
|
|
67
|
+
- `compareFiles()` - Detects binary/large files, compares contents
|
|
68
|
+
- `summarizeChanges()` - Returns added/removed line counts
|
|
69
|
+
- `generateDiff()` / `formatDiffForTerminal()` - Unified diff with colors
|
|
70
|
+
- Large file threshold: 100KB
|
|
71
|
+
|
|
72
|
+
**src/lib/prompt.js** - Interactive prompts
|
|
73
|
+
- `confirm()` - Yes/no prompts with defaults
|
|
74
|
+
- `select()` - Multi-option selection
|
|
75
|
+
- `confirmBatchUpdates()` - Bulk update confirmation
|
|
76
|
+
- Special handling for binary/large files
|
|
77
|
+
|
|
78
|
+
**src/commands/init.js** - Project initialization
|
|
79
|
+
- Validates target directory (checks for existing 2ndBrain projects or non-empty dirs)
|
|
80
|
+
- Creates framework and user data directories
|
|
81
|
+
- Copies framework files and .obsidian config
|
|
82
|
+
- Creates init-only files (e.g., 10_Inbox/Agents/Journal.md)
|
|
83
|
+
|
|
84
|
+
**src/commands/member.js** - Member directory creation
|
|
85
|
+
- Validates project is a 2ndBrain project
|
|
86
|
+
- Creates `10_Inbox/{member}/` directory
|
|
87
|
+
- Processes template files with `{{MEMBER_NAME}}` placeholder replacement
|
|
88
|
+
- Updates `.obsidian/daily-notes.json` (unless `--no-config`)
|
|
89
|
+
|
|
90
|
+
**src/commands/update.js** - Framework file updates
|
|
91
|
+
- Compares template files with existing files
|
|
92
|
+
- Shows diff with colored output for changes
|
|
93
|
+
- Supports batch (all), review (individual), or skip modes
|
|
94
|
+
- Also updates member dashboards using latest templates
|
|
95
|
+
|
|
96
|
+
**src/commands/remove.js** - Framework file removal
|
|
97
|
+
- Removes only framework files (never user data directories)
|
|
98
|
+
- Cleans up empty directories
|
|
99
|
+
|
|
100
|
+
### Key Design Patterns
|
|
101
|
+
|
|
102
|
+
**Smart File Management**: Files are compared before copying to avoid unnecessary writes. Binary and large files are detected and handled specially.
|
|
103
|
+
|
|
104
|
+
**Template System**: Member files use `{{MEMBER_NAME}}` placeholder that gets replaced during `member` command execution.
|
|
105
|
+
|
|
106
|
+
**Framework vs User Data Separation**:
|
|
107
|
+
- Framework files: Managed by CLI, can be updated/removed
|
|
108
|
+
- User data directories: Created during init, never modified by CLI
|
|
109
|
+
- This allows users to keep their content while updating framework
|
|
110
|
+
|
|
111
|
+
**Dry Run Mode**: Both `update` and `remove` support `--dry-run` to preview changes before applying.
|
|
112
|
+
|
|
113
|
+
## Directory Structure (PARA)
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
2ndBrain/
|
|
117
|
+
├── 00_Dashboard/ # Task aggregation dashboards (Dataview/Tasks queries)
|
|
118
|
+
├── 10_Inbox/ # Collection point (daily journals)
|
|
119
|
+
│ ├── Agents/ # AI assistant shared workspace
|
|
120
|
+
│ └── {MemberName}/ # Each member's personal directory
|
|
121
|
+
├── 20_Areas/ # Long-term focus areas
|
|
122
|
+
├── 30_Projects/ # Goal-oriented work
|
|
123
|
+
├── 40_Resources/ # Reference materials
|
|
124
|
+
├── 90_Archives/ # Completed/inactive content
|
|
125
|
+
└── 99_System/ # Templates and scripts
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Task Format Convention
|
|
129
|
+
|
|
130
|
+
Tasks use Markdown checkbox format with tags and dates:
|
|
131
|
+
```markdown
|
|
132
|
+
- [ ] Task description #tag 📅 YYYY-MM-DD
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Tags: `#next` (do next), `#waiting` (waiting on others), `#someday` (later), `#read`/`#watch`/`#listen` (consume lists)
|
|
136
|
+
|
|
137
|
+
## Dependencies
|
|
138
|
+
|
|
139
|
+
- `commander` - CLI framework
|
|
140
|
+
- `chalk` - Terminal colors
|
|
141
|
+
- `fs-extra` - Enhanced file system operations
|
|
142
|
+
- `diff` - File comparison/diff generation
|
|
143
|
+
|
|
144
|
+
## Node.js Requirement
|
|
145
|
+
|
|
146
|
+
Node.js >= 16.0.0 (specified in package.json `engines`)
|
|
147
|
+
|
|
148
|
+
## Important Notes
|
|
149
|
+
|
|
150
|
+
- The CLI is published as an npm package, so template files are bundled via `package.json` `files` field
|
|
151
|
+
- `.obsidian/` directory is included in the package to provide pre-configured plugins
|
|
152
|
+
- `AGENTS.md` serves as both documentation and the marker file for identifying 2ndBrain projects
|
|
153
|
+
- Member directories are excluded from automatic updates (must be re-run manually if needed)
|
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Our2ndBrain
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|