Cli
Classes
Classes
FlowStateCLI
FlowState CLI class Manages CLI commands and server connections
Constructor
constructor(configDir?: string | undefined)
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
configDir | string | undefined | No |
Methods
initialize
Initialize the CLI
initialize(): Promise<void>
Returns:
Promise<void> -
getConfigDir
Get config directory
getConfigDir(): string
Returns:
string -
getConfig
Get current configuration
getConfig(): FlowStateConfig
Returns:
FlowStateConfig -
executeCommand
Execute a command (for testing)
executeCommand(args: string[]): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
args | string[] | Yes |
Returns:
Promise<void> -
ensureContext
Ensure context (org/workspace) is set before operations If not set, prompts user to create or select
ensureContext(options?: { requireWorkspace?: boolean; }): Promise<boolean>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
options | { requireWorkspace?: boolean; } | No |
Returns:
Promise<boolean> -
close
Close the CLI and clean up resources
close(): Promise<void>
Returns:
Promise<void> -
AuthCommand
Export auth command for registration in FlowStateCLI
Constructor
constructor()
Methods
login
login(profileName?: string | undefined): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
profileName | string | undefined | No |
Returns:
Promise<void> -
logout
logout(profileName?: string | undefined, all?: boolean | undefined): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
profileName | string | undefined | No | |
all | boolean | undefined | No |
Returns:
Promise<void> -
status
status(profileName?: string | undefined): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
profileName | string | undefined | No |
Returns:
Promise<void> -
ContextCommand
Constructor
constructor(_client: IRxDBClient<any>, config: FlowStateConfig, logger: LoggingService, saveConfig: () => Promise<void>, registry?: CommandRegistry | undefined)
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
_client | IRxDBClient<any> | Yes | |
config | FlowStateConfig | Yes | |
logger | LoggingService | Yes | |
saveConfig | () => Promise<void> | Yes | |
registry | CommandRegistry | undefined | No |
Methods
setOrg
Set current organization
setOrg(options: ContextCommandOptions): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
options | ContextCommandOptions | Yes |
Returns:
Promise<void> -
setWorkspace
Set current workspace
setWorkspace(options: ContextCommandOptions): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
options | ContextCommandOptions | Yes |
Returns:
Promise<void> -
showContext
Show current context
showContext(): Promise<void>
Returns:
Promise<void> -
listOrganizationsCommand
List organizations
listOrganizationsCommand(options?: OrgListOptions): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
options | OrgListOptions | No |
Returns:
Promise<void> -
createOrganization
Create a new organization
createOrganization(options: OrgCreateOptions): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
options | OrgCreateOptions | Yes |
Returns:
Promise<void> -
listWorkspacesCommand
List workspaces
listWorkspacesCommand(options?: WorkspaceListOptions): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
options | WorkspaceListOptions | No |
Returns:
Promise<void> -
createWorkspace
Create a new workspace
createWorkspace(options: WorkspaceCreateOptions): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
options | WorkspaceCreateOptions | Yes |
Returns:
Promise<void> -
ensureContext
Ensure context is set (org and optionally workspace) If not set, prompt user to create or select Returns true if context is valid, false if user cancelled
ensureContext(options?: { requireWorkspace?: boolean; }): Promise<boolean>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
options | { requireWorkspace?: boolean; } | No |
Returns:
Promise<boolean> -
CreateAppCommand
Create App Command
Constructor
constructor(monorepoRoot?: string | undefined)
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
monorepoRoot | string | undefined | No |
Methods
execute
Execute the create-app command
execute(options: CreateAppOptions): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
options | CreateAppOptions | Yes |
Returns:
Promise<void> -
DiscoverCommand
Discover Command - analyzes codebase compliance with FlowState Standard
Constructor
constructor()
Methods
execute
execute(options?: DiscoverOptions): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
options | DiscoverOptions | No |
Returns:
Promise<void> -
DoctorCommand
Doctor Command - diagnoses FlowState environment
Constructor
constructor()
Methods
execute
Execute the doctor command
execute(options?: DoctorOptions): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
options | DoctorOptions | No |
Returns:
Promise<void> -
checkFlowstateConfig
Check FlowState configuration in current directory
checkFlowstateConfig(result: DoctorResult): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
result | DoctorResult | Yes |
Returns:
Promise<void> -
checkRepoRequirements
Check repository requirements (package.json, node version, etc.)
checkRepoRequirements(result: DoctorResult): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
result | DoctorResult | Yes |
Returns:
Promise<void> -
checkLocalServices
Check local services health Health checks bypass Kong Gateway and go directly to services for accurate monitoring
checkLocalServices(result: DoctorResult, options: DoctorOptions): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
result | DoctorResult | Yes | |
options | DoctorOptions | Yes |
Returns:
Promise<void> -
promptDockerSetup
Prompt user to set up docker containers
promptDockerSetup(options: DoctorOptions): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
options | DoctorOptions | Yes |
Returns:
Promise<void> -
InitCommand
FlowState init command implementation
Constructor
constructor(dependencyChecker: DependencyChecker, gitHelper: GitHelper, githubHelper: GitHubHelper, onePasswordHelper: OnePasswordHelper, fileTemplates: FileTemplates, codebaseManager?: CodebaseManager | undefined)
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
dependencyChecker | DependencyChecker | Yes | |
gitHelper | GitHelper | Yes | |
githubHelper | GitHubHelper | Yes | |
onePasswordHelper | OnePasswordHelper | Yes | |
fileTemplates | FileTemplates | Yes | |
codebaseManager | CodebaseManager | undefined | No |
Methods
execute
Execute init command
execute(options: InitOptions): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
options | InitOptions | Yes |
Returns:
Promise<void> -
InstallHookCommand
Methods
execute
execute(hookName: string): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
hookName | string | Yes |
Returns:
Promise<void> -
LinkCommand
Constructor
constructor(logger: LoggingService, registry: CommandRegistry)
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
logger | LoggingService | Yes | |
registry | CommandRegistry | Yes |
Methods
execute
Execute the link command
execute(_options?: LinkCommandOptions): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
_options | LinkCommandOptions | No |
Returns:
Promise<void> -
ScanTodosCommand
Constructor
constructor(client: IRxDBClient<any>, config: FlowStateConfig)
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
client | IRxDBClient<any> | Yes | |
config | FlowStateConfig | Yes |
Methods
execute
execute(options: ScanTodosOptions): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
options | ScanTodosOptions | Yes |
Returns:
Promise<void> -
ServerProfileCommand
ServerCommand class for programmatic use
Constructor
constructor()
Methods
add
add(name: string, options: { url: string; domain: string; displayName?: string; }): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | |
options | { url: string; domain: string; displayName?: string; } | Yes |
Returns:
Promise<void> -
list
list(): Promise<void>
Returns:
Promise<void> -
use
use(name: string): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes |
Returns:
Promise<void> -
remove
remove(name: string): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes |
Returns:
Promise<void> -
test
test(name?: string | undefined): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | undefined | No |
Returns:
Promise<void> -
getConfigManager
getConfigManager(): ConfigManager
Returns:
ConfigManager -
GenerateFiletreeCommand
Constructor
constructor(client: IRxDBClient<any>, config: FlowStateConfig)
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
client | IRxDBClient<any> | Yes | |
config | FlowStateConfig | Yes |
Methods
execute
execute(options: GenerateFiletreeOptions): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
options | GenerateFiletreeOptions | Yes |
Returns:
Promise<void> -
MappingsCommand
Constructor
constructor(_config: FlowStateConfig)
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
_config | FlowStateConfig | Yes |
Methods
execute
execute(options: MappingsOptions): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
options | MappingsOptions | Yes |
Returns:
Promise<void> -
listByFile
listByFile(filePath: string): Promise<string>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
filePath | string | Yes |
Returns:
Promise<string> -
listByTask
listByTask(taskId: string): Promise<string>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
taskId | string | Yes |
Returns:
Promise<string> -
listByDocument
listByDocument(documentId: string): Promise<string>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
documentId | string | Yes |
Returns:
Promise<string> -
listBySpec
listBySpec(specId: string): Promise<string>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
specId | string | Yes |
Returns:
Promise<string> -
listAll
listAll(type?: MappingType | undefined): Promise<string>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
type | MappingType | undefined | No |
Returns:
Promise<string> -
MigrateMappingsCommand
Constructor
constructor(_config: FlowStateConfig, projectRoot?: string | undefined)
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
_config | FlowStateConfig | Yes | |
projectRoot | string | undefined | No |
Methods
execute
execute(options?: MigrateOptions): Promise<MigrationResult>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
options | MigrateOptions | No |
Returns:
Promise<MigrationResult> -
SyncAgentsCommand
Constructor
constructor(client: IRxDBClient<any>, config: FlowStateConfig)
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
client | IRxDBClient<any> | Yes | |
config | FlowStateConfig | Yes |
Methods
execute
execute(options: SyncAgentsOptions): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
options | SyncAgentsOptions | Yes |
Returns:
Promise<void> -
SyncAllCommand
Constructor
constructor(_client: IRxDBClient<any>, _config: FlowStateConfig)
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
_client | IRxDBClient<any> | Yes | |
_config | FlowStateConfig | Yes |
Methods
execute
execute(options: SyncAllOptions): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
options | SyncAllOptions | Yes |
Returns:
Promise<void> -
SyncMarkdownFilesCommand
Constructor
constructor(client: IRxDBClient<any>, config: FlowStateConfig, authToken?: string | undefined)
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
client | IRxDBClient<any> | Yes | |
config | FlowStateConfig | Yes | |
authToken | string | undefined | No |
Methods
execute
execute(options: SyncMarkdownOptions): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
options | SyncMarkdownOptions | Yes |
Returns:
Promise<void> -
CollectionManager
Generic CRUD manager for any collection
Constructor
constructor(client: IRxDBClient<any>, collectionName: string, schema: RxJsonSchema<any>)
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
client | IRxDBClient<any> | Yes | |
collectionName | string | Yes | |
schema | RxJsonSchema<any> | Yes |
Methods
create
Create a new document
create(data: Partial<TDocument>): Promise<TDocument>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
data | Partial<TDocument> | Yes |
Returns:
Promise<TDocument> -
get
Get a document by ID
get(id: string): Promise<TDocument | null>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes |
Returns:
Promise<TDocument \| null> -
list
List documents with filters
list(filters?: QueryFilters | undefined): Promise<TDocument[]>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
filters | QueryFilters | undefined | No |
Returns:
Promise<TDocument[]> -
update
Update a document
update(id: string, updates: Partial<TDocument>): Promise<TDocument>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | |
updates | Partial<TDocument> | Yes |
Returns:
Promise<TDocument> -
delete
Delete a document
delete(id: string): Promise<boolean>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes |
Returns:
Promise<boolean> -
query
Query documents with RxDB selector
query(selector: any): Promise<TDocument[]>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
selector | any | Yes |
Returns:
Promise<TDocument[]> -
bulkCreate
Bulk create documents
bulkCreate(items: Partial<TDocument>[]): Promise<TDocument[]>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
items | Partial<TDocument>[] | Yes |
Returns:
Promise<TDocument[]> -
CommandRegistry
Registry for auto-discovered collections
Methods
initialize
Initialize registry by discovering collections
initialize(client: IRxDBClient<any>, options?: { defaultOrgId?: string; defaultUserId?: string; } | undefined): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
client | IRxDBClient<any> | Yes | |
options | { defaultOrgId?: string; defaultUserId?: string; } | undefined | No |
Returns:
Promise<void> -
getManager
Get manager for a collection
getManager(collectionName: string): CollectionManager<any>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
collectionName | string | Yes |
Returns:
CollectionManager<any> -
getAllCollectionNames
Get all collection names
getAllCollectionNames(): string[]
Returns:
string[] -
getCollectionSchema
Get schema for a collection
getCollectionSchema(collectionName: string): RxJsonSchema<any>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
collectionName | string | Yes |
Returns:
RxJsonSchema<any> -
getDefaultOrgId
Get default org ID
getDefaultOrgId(): string | undefined
Returns:
string \| undefined -
getDefaultUserId
Get default user ID
getDefaultUserId(): string | undefined
Returns:
string \| undefined -
InteractivePrompts
Interactive prompts for user-friendly document creation
Methods
promptForDocument
Prompt user for document fields based on schema
promptForDocument(schema: RxJsonSchema<any>, collectionName: string): Promise<any>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
schema | RxJsonSchema<any> | Yes | |
collectionName | string | Yes |
Returns:
Promise<any> -
confirmDelete
Confirm deletion
confirmDelete(collectionName: string, id: string): Promise<boolean>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
collectionName | string | Yes | |
id | string | Yes |
Returns:
Promise<boolean> -
selectFromList
Select from list
selectFromList(message: string, choices: string[]): Promise<string>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
message | string | Yes | |
choices | string[] | Yes |
Returns:
Promise<string> -
confirm
Confirm action
confirm(message: string, defaultValue?: boolean): Promise<boolean>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
message | string | Yes | |
defaultValue | boolean | No |
Returns:
Promise<boolean> -
LoggingService
Constructor
constructor(config?: Partial<LoggingConfig> | undefined)
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
config | Partial<LoggingConfig> | undefined | No |
Methods
configure
Update logging configuration
configure(config: Partial<LoggingConfig>): void
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
config | Partial<LoggingConfig> | Yes |
setVerbose
Enable verbose mode
setVerbose(verbose: boolean): void
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
verbose | boolean | Yes |
setLevel
Set log level
setLevel(level: LogLevel): void
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
level | LogLevel | Yes |
isVerbose
Check if verbose mode is enabled
isVerbose(): boolean
Returns:
boolean -
debug
Log debug message (only in verbose mode)
debug(message: string, args?: any[]): void
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
message | string | Yes | |
args | any[] | No |
info
Log info message
info(message: string, args?: any[]): void
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
message | string | Yes | |
args | any[] | No |
warn
Log warning message
warn(message: string, args?: any[]): void
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
message | string | Yes | |
args | any[] | No |
error
Log error message
error(message: string, error?: any, args?: any[]): void
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
message | string | Yes | |
error | any | No | |
args | any[] | No |
success
Log success message
success(message: string, args?: any[]): void
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
message | string | Yes | |
args | any[] | No |
child
Create a child logger with a prefix
child(prefix: string): LoggingService
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
prefix | string | Yes |
Returns:
LoggingService -
ObsSessionContext
ObsSessionContext - Singleton class for managing session context
Constructor
constructor()
Methods
getInstance
Get singleton instance
getInstance(): ObsSessionContext
Returns:
ObsSessionContext - The singleton instance of ObsSessionContext
setContext
Set session context and update environment variables This performs a shallow merge with existing context.
setContext(data: Partial<SessionContextData>): void
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
data | Partial<SessionContextData> | Yes | - Partial session context data to set |
Examples:
const obsContext = ObsSessionContext.getInstance();
obsContext.setContext({
projectId: 'proj-123',
taskId: 'task-456'
});
getContext
Get current session context
getContext(): SessionContextData
Returns:
SessionContextData - Current session context data
Examples:
const obsContext = ObsSessionContext.getInstance();
const context = obsContext.getContext();
console.log(context.projectId);
clearContext
Clear all session context and environment variables
clearContext(): void
Examples:
const obsContext = ObsSessionContext.getInstance();
obsContext.clearContext();
resetInstance
Reset singleton instance (primarily for testing)
resetInstance(): void
Examples:
const obsContext = ObsSessionContext.getInstance();
obsContext.setContext({
projectId: project.id,
taskId: task.id,
specName: spec.name,
userId: config.userId,
gitBranch: await getCurrentGitBranch(),
workingDirectory: process.cwd()
});
// Later retrieve context
const context = obsContext.getContext();
console.log(context.projectId); // project.id
// Clear context when done
obsContext.clearContext();
OutputFormatter
Output formatter for consistent CLI display
Methods
format
Format data based on output type
format(data: any, format: "table" | "json" | "yaml" | "csv", schema?: RxJsonSchema<any> | undefined): string
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
data | any | Yes | |
format | "table" | "json" | "yaml" | "csv" | Yes | |
schema | RxJsonSchema<any> | undefined | No |
Returns:
string -
QueryBuilder
Query builder for translating CLI options to RxDB queries
Methods
parseFilter
Parse filter string into RxDB selector Supports both JSON and simple key=value syntax
parseFilter(filterStr: string): any
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
filterStr | string | Yes |
Returns:
any -
buildQueryOptions
Build complete query options from CLI flags
buildQueryOptions(options: { filter?: string; sort?: string; limit?: string; skip?: string; }): QueryFilters
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
options | { filter?: string; sort?: string; limit?: string; skip?: string; } | Yes |
Returns:
QueryFilters -
DependencyChecker
Utility class for checking system dependencies
Methods
checkDependency
Check if a dependency is installed
checkDependency(dep: string): Promise<DependencyCheckResult>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
dep | string | Yes |
Returns:
Promise<DependencyCheckResult> -
checkAll
Check all dependencies for a project type
checkAll(deps: Record<string, string | boolean>): Promise<Map<string, DependencyCheckResult>>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
deps | Record<string, string | boolean> | Yes |
Returns:
Promise<Map<string, DependencyCheckResult>> -
displayResults
Display dependency check results
displayResults(results: Map<string, DependencyCheckResult>): void
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
results | Map<string, DependencyCheckResult> | Yes |
hasMissingDependencies
Check if any required dependencies are missing
hasMissingDependencies(results: Map<string, DependencyCheckResult>): boolean
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
results | Map<string, DependencyCheckResult> | Yes |
Returns:
boolean -
FileTemplates
Utility class for generating file templates
Methods
generateClaudeMd
Generate CLAUDE.md based on project type
generateClaudeMd(config: { projectName: string; projectType: string; description?: string; }): string
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
config | { projectName: string; projectType: string; description?: string; } | Yes |
Returns:
string -
generateMcpJson
Generate .mcp.json based on project type
generateMcpJson(projectType: string, _customServers?: string[] | undefined): object
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectType | string | Yes | |
_customServers | string[] | undefined | No |
Returns:
object -
generateFlowstateReadme
Generate .flowstate/README.md
generateFlowstateReadme(): string
Returns:
string -
copyClaudeTemplate
Copy .claude template directory
copyClaudeTemplate(targetPath: string, commands: string[]): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
targetPath | string | Yes | |
commands | string[] | Yes |
Returns:
Promise<void> -
FlowStateEntityHelper
Helper class for managing FlowState entities during init
Constructor
constructor(client: RxDBClient)
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
client | RxDBClient | Yes |
Methods
selectOrCreateOrg
Select or create an organization
selectOrCreateOrg(options?: { yes?: boolean; orgId?: string; }): Promise<Org>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
options | { yes?: boolean; orgId?: string; } | No |
Returns:
Promise<Org> -
selectOrCreateWorkspace
Select or create a workspace
selectOrCreateWorkspace(orgId: string, userId: string, options?: { yes?: boolean; workspaceId?: string; projectName?: string; }): Promise<Workspace>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
orgId | string | Yes | |
userId | string | Yes | |
options | { yes?: boolean; workspaceId?: string; projectName?: string; } | No |
Returns:
Promise<Workspace> -
selectOrCreateUser
Select or create a user
selectOrCreateUser(orgId: string, options?: { yes?: boolean; userId?: string; }): Promise<User>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
orgId | string | Yes | |
options | { yes?: boolean; userId?: string; } | No |
Returns:
Promise<User> -
createProject
Create a project linked to a codebase
createProject(orgId: string, userId: string, workspaceId: string, codebaseId: string, projectName: string, options?: { description?: string; }): Promise<Project>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
orgId | string | Yes | |
userId | string | Yes | |
workspaceId | string | Yes | |
codebaseId | string | Yes | |
projectName | string | Yes | |
options | { description?: string; } | No |
Returns:
Promise<Project> -
validateEntities
Validate that all entities exist and are properly linked
validateEntities(orgId: string, workspaceId: string, userId: string, codebaseId?: string | undefined, projectId?: string | undefined): Promise<{ valid: boolean; issues: string[]; }>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
orgId | string | Yes | |
workspaceId | string | Yes | |
userId | string | Yes | |
codebaseId | string | undefined | No | |
projectId | string | undefined | No |
Returns:
Promise<{ valid: boolean; issues: string[]; }> -
runEntitySelectionFlow
Run the full entity selection flow Returns orgId, workspaceId, and userId for use in init
runEntitySelectionFlow(options?: { yes?: boolean; orgId?: string; workspaceId?: string; userId?: string; projectName?: string; }): Promise<EntitySelectionResult>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
options | { yes?: boolean; orgId?: string; workspaceId?: string; userId?: string; projectName?: string; } | No |
Returns:
Promise<EntitySelectionResult> -
GitHelper
Utility class for Git operations
Methods
isGitInitialized
Check if git is initialized in directory
isGitInitialized(projectPath: string): Promise<boolean>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectPath | string | Yes |
Returns:
Promise<boolean> -
initGit
Initialize git repository
initGit(projectPath: string): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectPath | string | Yes |
Returns:
Promise<void> -
getRemoteUrl
Get current remote URL if exists
getRemoteUrl(projectPath: string): Promise<string | null>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectPath | string | Yes |
Returns:
Promise<string \| null> -
createGitignore
Create .gitignore file
createGitignore(projectPath: string, entries: string[]): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectPath | string | Yes | |
entries | string[] | Yes |
Returns:
Promise<void> -
addRemote
Add git remote
addRemote(projectPath: string, url: string): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectPath | string | Yes | |
url | string | Yes |
Returns:
Promise<void> -
createInitialCommit
Create initial commit
createInitialCommit(projectPath: string): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectPath | string | Yes |
Returns:
Promise<void> -
push
Push to remote
push(projectPath: string): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectPath | string | Yes |
Returns:
Promise<void> -
getCurrentBranch
Get current git branch name
getCurrentBranch(projectPath?: string | undefined): string | undefined
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectPath | string | undefined | No |
Returns:
string \| undefined -
GitHubHelper
Utility class for GitHub CLI operations
Methods
isAuthenticated
Check if GitHub CLI is authenticated
isAuthenticated(): Promise<boolean>
Returns:
Promise<boolean> -
createRepo
Create new GitHub repository
createRepo(options: { name: string; description: string; private: boolean; projectPath: string; }): Promise<{ url: string; success: boolean; }>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
options | { name: string; description: string; private: boolean; projectPath: string; } | Yes |
Returns:
Promise<{ url: string; success: boolean; }> -
linkRepo
Link to existing repository
linkRepo(repoUrl: string, projectPath: string): Promise<boolean>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
repoUrl | string | Yes | |
projectPath | string | Yes |
Returns:
Promise<boolean> -
pushInitialCommit
Push initial commit
pushInitialCommit(projectPath: string): Promise<boolean>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectPath | string | Yes |
Returns:
Promise<boolean> -
HttpRxDBClient
HTTP-based RxDB client for CLI operations Implements the RxDBClient interface for FlowStateEntityHelper
Constructor
constructor(options: HttpClientOptions)
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
options | HttpClientOptions | Yes |
Methods
query
Query documents in a collection
query(collection: string, selector: object, options?: { sort?: any[]; limit?: number; } | undefined): Promise<T[]>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
collection | string | Yes | |
selector | object | Yes | |
options | { sort?: any[]; limit?: number; } | undefined | No |
Returns:
Promise<T[]> -
get
Get a single document by ID
get(collection: string, id: string): Promise<T | null>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
collection | string | Yes | |
id | string | Yes |
Returns:
Promise<T \| null> -
create
Create a new document using the /set endpoint The RxDB server REST plugin uses /set for creating/updating documents
create(collection: string, data: Partial<T>): Promise<T>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
collection | string | Yes | |
data | Partial<T> | Yes |
Returns:
Promise<T> -
update
Update an existing document using the /set endpoint The RxDB server REST plugin uses /set for creating/updating documents
update(collection: string, id: string, data: Partial<T>): Promise<T>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
collection | string | Yes | |
id | string | Yes | |
data | Partial<T> | Yes |
Returns:
Promise<T> -
testConnection
Test connection to the RxDB server
testConnection(): Promise<boolean>
Returns:
Promise<boolean> -
DryRunRxDBClient
Dry-run RxDB client that wraps a real client
- Passes through query(), get(), testConnection() to the real client
- Intercepts create() calls to collect planned operations
- Returns mock entities with pre-generated IDs for creates
Constructor
constructor(realClient: HttpRxDBClient)
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
realClient | HttpRxDBClient | Yes |
Methods
getPlannedOperations
Get all planned operations collected during dry-run
getPlannedOperations(): PlannedOperation[]
Returns:
PlannedOperation[] -
clearPlannedOperations
Clear planned operations
clearPlannedOperations(): void
query
Query documents - passes through to real client
query(collection: string, selector: object, options?: { sort?: any[]; limit?: number; } | undefined): Promise<T[]>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
collection | string | Yes | |
selector | object | Yes | |
options | { sort?: any[]; limit?: number; } | undefined | No |
Returns:
Promise<T[]> -
get
Get a single document - passes through to real client
get(collection: string, id: string): Promise<T | null>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
collection | string | Yes | |
id | string | Yes |
Returns:
Promise<T \| null> -
create
Create a new document - intercepted for dry-run Records the planned operation and returns a mock entity
create(collection: string, data: Partial<T>): Promise<T>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
collection | string | Yes | |
data | Partial<T> | Yes |
Returns:
Promise<T> -
update
Update a document - passes through to real client (In dry-run we don't update existing entities)
update(collection: string, id: string, data: Partial<T>): Promise<T>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
collection | string | Yes | |
id | string | Yes | |
data | Partial<T> | Yes |
Returns:
Promise<T> -
testConnection
Test connection - passes through to real client
testConnection(): Promise<boolean>
Returns:
Promise<boolean> -
recordExistingEntity
Record that an existing entity is being used
recordExistingEntity(collection: string, id: string, data?: Record<string, unknown>): void
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
collection | string | Yes | |
id | string | Yes | |
data | Record<string, unknown> | No |
OnePasswordHelper
Utility class for 1Password CLI operations
Methods
isInstalled
Check if 1Password CLI is installed
isInstalled(): Promise<boolean>
Returns:
Promise<boolean> -
isSignedIn
Check if user is signed in
isSignedIn(): Promise<boolean>
Returns:
Promise<boolean> -
listVaults
List available vaults
listVaults(): Promise<{ id: string; name: string; }[]>
Returns:
Promise<{ id: string; name: string; }[]> -
createVault
Create new vault
createVault(name: string, description: string): Promise<{ success: boolean; vaultId?: string; vaultName?: string; }>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | |
description | string | Yes |
Returns:
Promise<{ success: boolean; vaultId?: string; vaultName?: string; }> -
storeSecret
Store secret in vault
storeSecret(options: { vault: string; itemName: string; fields: Record<string, string>; tags?: string[]; }): Promise<boolean>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
options | { vault: string; itemName: string; fields: Record<string, string>; tags?: string[]; } | Yes |
Returns:
Promise<boolean> -
getSecretReference
Get secret reference for use in config
getSecretReference(vault: string, itemName: string, field: string): Promise<string>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
vault | string | Yes | |
itemName | string | Yes | |
field | string | Yes |
Returns:
Promise<string> -
getSecret
Retrieve secret value
getSecret(reference: string): Promise<string | null>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
reference | string | Yes |
Returns:
Promise<string \| null> -
AgentScanner
Scans and parses agent JSON files from .flowstate/agents directory
Constructor
constructor(config?: Partial<AgentScannerConfig> | undefined)
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
config | Partial<AgentScannerConfig> | undefined | No |
Methods
scan
Scan for all agent JSON files
scan(): Promise<AgentFile[]>
Returns:
Promise<AgentFile[]> -
parseAgentFile
Parse a single agent JSON file
parseAgentFile(filePath: string): Promise<AgentFile | null>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
filePath | string | Yes |
Returns:
Promise<AgentFile \| null> -
getByName
Get a single agent by name
getByName(name: string): Promise<AgentFile | null>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes |
Returns:
Promise<AgentFile \| null> -
getByTeamMemberId
Get a single agent by team member ID
getByTeamMemberId(teamMemberId: string): Promise<AgentFile | null>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
teamMemberId | string | Yes |
Returns:
Promise<AgentFile \| null> -
writeAgentFile
Write an agent configuration to a JSON file
writeAgentFile(agent: AgentFile): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
agent | AgentFile | Yes |
Returns:
Promise<void> -
updateAgentMetadata
Update agent file with new metadata
updateAgentMetadata(name: string, updates: Partial<import("/Users/sthornock/code/epic/epic-flowstate/packages/flowstate-cli/src/lib/agent-sync/types").AgentMetadata | undefined>): Promise<AgentFile | null>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | |
updates | Partial<import("/Users/sthornock/code/epic/epic-flowstate/packages/flowstate-cli/src/lib/agent-sync/types").AgentMetadata | undefined> | Yes |
Returns:
Promise<AgentFile \| null> -
getLinkedAgents
Get agents that have a teamMemberId configured
getLinkedAgents(): Promise<AgentFile[]>
Returns:
Promise<AgentFile[]> -
getUnlinkedAgents
Get agents that do NOT have a teamMemberId configured
getUnlinkedAgents(): Promise<AgentFile[]>
Returns:
Promise<AgentFile[]> -
AgentSyncManager
Manages two-way sync between local agent JSON files and TeamMember entities
Constructor
constructor(client: IRxDBClient<any>, scanner?: AgentScanner | undefined)
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
client | IRxDBClient<any> | Yes | |
scanner | AgentScanner | undefined | No |
Methods
sync
Perform full bidirectional sync
sync(orgId: string, dryRun?: boolean, direction?: "bidirectional" | "local-to-remote" | "remote-to-local"): Promise<AgentSyncStats>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
orgId | string | Yes | |
dryRun | boolean | No | |
direction | "bidirectional" | "local-to-remote" | "remote-to-local" | No |
Returns:
Promise<AgentSyncStats> -
generateSummary
Generate a summary report
generateSummary(orgId: string, dryRun: boolean, direction?: "bidirectional" | "local-to-remote" | "remote-to-local"): Promise<string>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
orgId | string | Yes | |
dryRun | boolean | Yes | |
direction | "bidirectional" | "local-to-remote" | "remote-to-local" | No |
Returns:
Promise<string> -
generateJsonSummary
Generate JSON summary
generateJsonSummary(orgId: string, dryRun: boolean, direction?: "bidirectional" | "local-to-remote" | "remote-to-local"): Promise<AgentSyncSummaryJson>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
orgId | string | Yes | |
dryRun | boolean | Yes | |
direction | "bidirectional" | "local-to-remote" | "remote-to-local" | No |
Returns:
Promise<AgentSyncSummaryJson> -
DocumentStoreClient
Constructor
constructor(config: DocumentStoreClientConfig)
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
config | DocumentStoreClientConfig | Yes |
Methods
requestUpload
Request a presigned upload URL from the document-store service.
requestUpload(request: UploadRequest): Promise<UploadResponse>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
request | UploadRequest | Yes | - Upload request containing filename, mimeType, and optional metadata |
Returns:
Promise<UploadResponse> - Promise resolving to upload response with presigned URL and document info
uploadContent
Upload content to a presigned S3 URL.
uploadContent(uploadUrl: string, content: string | Buffer<ArrayBufferLike>, contentType?: string): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
uploadUrl | string | Yes | - Presigned S3 URL from requestUpload response |
content | string | Buffer<ArrayBufferLike> | Yes | - File content as Buffer or string |
contentType | string | No | - MIME type for the Content-Type header |
Returns:
Promise<void> -
requestDownload
Request a presigned download URL for a document.
requestDownload(documentId: string): Promise<DownloadResponse>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
documentId | string | Yes | - Document ID from the document-store |
Returns:
Promise<DownloadResponse> - Promise resolving to download response with presigned URL
healthCheck
Test connection to the document-store service. Uses the status endpoint which exists at /api/document-store/status. Includes auth token since endpoint is behind auth gateway.
healthCheck(): Promise<boolean>
Returns:
Promise<boolean> - Promise resolving to true if healthy, false otherwise
FileMetadataCollector
Methods
collect
Collect metadata for a single file or directory
collect(filePath: string, includeGitInfo?: boolean, includeContentHash?: boolean): Promise<FileMetadata>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
filePath | string | Yes | |
includeGitInfo | boolean | No | |
includeContentHash | boolean | No |
Returns:
Promise<FileMetadata> -
FiletreeBuilder
Constructor
constructor(config: FiletreeGeneratorConfig)
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
config | FiletreeGeneratorConfig | Yes |
Methods
build
Build filetree for a directory
build(rootPath: string): Promise<Filetree>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
rootPath | string | Yes |
Returns:
Promise<Filetree> -
FiletreeGenerator
Constructor
constructor(db: RxDatabase, config: FiletreeGeneratorConfig)
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
db | RxDatabase | Yes | |
config | FiletreeGeneratorConfig | Yes |
Methods
generate
Generate and sync filetree
generate(rootPath: string, orgId: string, projectId?: string | undefined, workspaceId?: string | undefined, dryRun?: boolean): Promise<FiletreeSyncStats>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
rootPath | string | Yes | |
orgId | string | Yes | |
projectId | string | undefined | No | |
workspaceId | string | undefined | No | |
dryRun | boolean | No |
Returns:
Promise<FiletreeSyncStats> -
generateSummary
Generate markdown summary
generateSummary(rootPath: string, orgId: string, projectId?: string | undefined, workspaceId?: string | undefined, dryRun?: boolean): Promise<string>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
rootPath | string | Yes | |
orgId | string | Yes | |
projectId | string | undefined | No | |
workspaceId | string | undefined | No | |
dryRun | boolean | No |
Returns:
Promise<string> -
generateJsonSummary
Generate JSON summary
generateJsonSummary(rootPath: string, orgId: string, projectId?: string | undefined, workspaceId?: string | undefined, dryRun?: boolean): Promise<FiletreeSummaryJson>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
rootPath | string | Yes | |
orgId | string | Yes | |
projectId | string | undefined | No | |
workspaceId | string | undefined | No | |
dryRun | boolean | No |
Returns:
Promise<FiletreeSummaryJson> -
FiletreeSyncManager
Constructor
constructor(db: RxDatabase)
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
db | RxDatabase | Yes |
Methods
sync
Sync filetree to database as SteeringDocument
sync(filetree: Filetree, orgId: string, projectId?: string | undefined, workspaceId?: string | undefined, userId?: string | undefined, dryRun?: boolean): Promise<FiletreeSyncStats>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
filetree | Filetree | Yes | |
orgId | string | Yes | |
projectId | string | undefined | No | |
workspaceId | string | undefined | No | |
userId | string | undefined | No | |
dryRun | boolean | No |
Returns:
Promise<FiletreeSyncStats> -
MappingManager
Constructor
constructor(config: MappingManagerConfig)
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
config | MappingManagerConfig | Yes |
Methods
loadMappings
loadMappings(type: MappingType): Promise<MappingFile>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
type | MappingType | Yes |
Returns:
Promise<MappingFile> -
saveMappings
saveMappings(type: MappingType, data: MappingFile): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
type | MappingType | Yes | |
data | MappingFile | Yes |
Returns:
Promise<void> -
addMapping
addMapping(type: MappingType, key: string, value: any): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
type | MappingType | Yes | |
key | string | Yes | |
value | any | Yes |
Returns:
Promise<void> -
getMapping
getMapping(type: MappingType, key: string): Promise<any>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
type | MappingType | Yes | |
key | string | Yes |
Returns:
Promise<any> -
removeMapping
removeMapping(type: MappingType, key: string): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
type | MappingType | Yes | |
key | string | Yes |
Returns:
Promise<void> -
findByFile
findByFile(filePath: string): Promise<any[]>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
filePath | string | Yes |
Returns:
Promise<any[]> -
findByTaskId
findByTaskId(taskId: string): Promise<KeyedMapping[]>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
taskId | string | Yes |
Returns:
Promise<KeyedMapping[]> -
findByDocumentId
findByDocumentId(documentId: string): Promise<KeyedMapping[]>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
documentId | string | Yes |
Returns:
Promise<KeyedMapping[]> -
MarkdownParser
Methods
parseFile
Parse a markdown file and extract metadata
parseFile(filePath: string): Promise<MarkdownFile>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
filePath | string | Yes |
Returns:
Promise<MarkdownFile> -
parseFiles
Parse multiple markdown files
parseFiles(filePaths: string[]): Promise<MarkdownFile[]>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
filePaths | string[] | Yes |
Returns:
Promise<MarkdownFile[]> -
MarkdownScanner
Constructor
constructor(db: RxDatabase, config: MarkdownScannerConfig, projectRoot?: string | undefined)
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
db | RxDatabase | Yes | |
config | MarkdownScannerConfig | Yes | |
projectRoot | string | undefined | No |
Methods
scanMarkdownFile
Scan a single markdown file and optionally store mapping
scanMarkdownFile(filePath: string, documentType: string): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
filePath | string | Yes | |
documentType | string | Yes |
Returns:
Promise<void> -
scan
Scan and sync markdown files
scan(orgId: string, projectId?: string | undefined, workspaceId?: string | undefined, dryRun?: boolean): Promise<MarkdownSyncStats>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
orgId | string | Yes | |
projectId | string | undefined | No | |
workspaceId | string | undefined | No | |
dryRun | boolean | No |
Returns:
Promise<MarkdownSyncStats> -
generateSummary
Generate markdown summary
generateSummary(orgId: string, projectId?: string | undefined, workspaceId?: string | undefined, dryRun?: boolean): Promise<string>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
orgId | string | Yes | |
projectId | string | undefined | No | |
workspaceId | string | undefined | No | |
dryRun | boolean | No |
Returns:
Promise<string> -
generateJsonSummary
Generate JSON summary
generateJsonSummary(orgId: string, projectId?: string | undefined, workspaceId?: string | undefined, dryRun?: boolean): Promise<MarkdownSummaryJson>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
orgId | string | Yes | |
projectId | string | undefined | No | |
workspaceId | string | undefined | No | |
dryRun | boolean | No |
Returns:
Promise<MarkdownSummaryJson> -
MarkdownSyncManager
Constructor
constructor(db: RxDatabase)
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
db | RxDatabase | Yes |
Methods
syncFile
Sync a single markdown file to the database
syncFile(markdownFile: MarkdownFile, orgId: string, projectId?: string | undefined, workspaceId?: string | undefined, userId?: string | undefined, dryRun?: boolean): Promise<MarkdownSyncResult>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
markdownFile | MarkdownFile | Yes | |
orgId | string | Yes | |
projectId | string | undefined | No | |
workspaceId | string | undefined | No | |
userId | string | undefined | No | |
dryRun | boolean | No |
Returns:
Promise<MarkdownSyncResult> -
syncFiles
Sync multiple markdown files
syncFiles(files: MarkdownFile[], orgId: string, projectId?: string | undefined, workspaceId?: string | undefined, userId?: string | undefined, dryRun?: boolean): Promise<MarkdownSyncStats>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
files | MarkdownFile[] | Yes | |
orgId | string | Yes | |
projectId | string | undefined | No | |
workspaceId | string | undefined | No | |
userId | string | undefined | No | |
dryRun | boolean | No |
Returns:
Promise<MarkdownSyncStats> -
StorageBackedSyncManager
Constructor
constructor(config: StorageBackedSyncManagerConfig)
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
config | StorageBackedSyncManagerConfig | Yes |
Methods
syncFile
Sync a single markdown file to RxDB with content in document-store.
syncFile(markdownFile: MarkdownFile, orgId: string, projectId?: string | undefined, workspaceId?: string | undefined, userId?: string | undefined, dryRun?: boolean): Promise<StorageBackedSyncResult>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
markdownFile | MarkdownFile | Yes | - Parsed markdown file info |
orgId | string | Yes | - Organization ID |
projectId | string | undefined | No | - Optional project ID |
workspaceId | string | undefined | No | - Optional workspace ID |
userId | string | undefined | No | - User ID from authenticated CLI session |
dryRun | boolean | No | - If true, don't actually sync |
Returns:
Promise<StorageBackedSyncResult> - Sync result
syncFiles
Sync multiple markdown files.
syncFiles(files: MarkdownFile[], orgId: string, projectId?: string | undefined, workspaceId?: string | undefined, dryRun?: boolean): Promise<StorageBackedSyncStats>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
files | MarkdownFile[] | Yes | - Array of parsed markdown files |
orgId | string | Yes | - Organization ID |
projectId | string | undefined | No | - Optional project ID |
workspaceId | string | undefined | No | - Optional workspace ID |
dryRun | boolean | No | - If true, don't actually sync |
Returns:
Promise<StorageBackedSyncStats> - Sync statistics
TodoFileWriter
Methods
updateTodoComment
Update TODO comment with metadata
updateTodoComment(filePath: string, lineNumber: number, metadata: TodoMetadata): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
filePath | string | Yes | |
lineNumber | number | Yes | |
metadata | TodoMetadata | Yes |
Returns:
Promise<void> -
removeTodoMetadata
Remove TODO comment metadata
removeTodoMetadata(filePath: string, lineNumber: number): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
filePath | string | Yes | |
lineNumber | number | Yes |
Returns:
Promise<void> -
TodoParser
Constructor
constructor(projectPath?: string, additionalSkipDirs?: string[])
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectPath | string | No | |
additionalSkipDirs | string[] | No |
Methods
scanFile
Scan a single file for TODO comments
scanFile(filePath: string): Promise<TodoScanResult>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
filePath | string | Yes |
Returns:
Promise<TodoScanResult> -
scanDirectory
Scan directory recursively for TODO comments
scanDirectory(dirPath: string): Promise<TodoScanResult>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
dirPath | string | Yes |
Returns:
Promise<TodoScanResult> -
TodoScanner
Constructor
constructor(client: IRxDBClient<any>, projectId: string, projectPath?: string, orgId?: string, userId?: string, ignorePaths?: string[], groupByFile?: boolean, config?: TodoScannerConfig)
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
client | IRxDBClient<any> | Yes | |
projectId | string | Yes | |
projectPath | string | No | |
orgId | string | No | |
userId | string | No | |
ignorePaths | string[] | No | |
groupByFile | boolean | No | |
config | TodoScannerConfig | No |
Methods
scanAndSync
Scan and sync TODOs
scanAndSync(options?: ScanOptions): Promise<ScanResult>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
options | ScanOptions | No |
Returns:
Promise<ScanResult> -
TodoSyncManager
Constructor
constructor(client: IRxDBClient<any>, projectId: string, orgId: string, userId: string, groupByFile?: boolean)
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
client | IRxDBClient<any> | Yes | |
projectId | string | Yes | |
orgId | string | Yes | |
userId | string | Yes | |
groupByFile | boolean | No |
Methods
createTaskFromTodo
Create task from TODO comment
createTaskFromTodo(todo: TodoComment): Promise<string>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
todo | TodoComment | Yes |
Returns:
Promise<string> -
createGroupedTaskFromTodos
Create a single grouped task from multiple TODOs in the same file
createGroupedTaskFromTodos(todos: TodoComment[], filePath: string): Promise<string>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
todos | TodoComment[] | Yes | |
filePath | string | Yes |
Returns:
Promise<string> -
syncTodo
Sync TODO comment with task system
syncTodo(todo: TodoComment, dryRun?: boolean): Promise<SyncResult>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
todo | TodoComment | Yes | |
dryRun | boolean | No |
Returns:
Promise<SyncResult> -
syncAll
Sync all TODOs in batch
syncAll(todos: TodoComment[], dryRun?: boolean): Promise<{ results: Map<TodoComment, SyncResult>; stats: TodoSyncStats; }>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
todos | TodoComment[] | Yes | |
dryRun | boolean | No |
Returns:
Promise<{ results: Map<TodoComment, SyncResult>; stats: TodoSyncStats; }> -