Skip to content
Merged
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
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ members = [
]

[workspace.package]
version = "2026.10403.117"
version = "2026.10404.101"
edition = "2024"
rust-version = "1.88"
license = "AGPL-3.0-only"
Expand Down
2 changes: 1 addition & 1 deletion cli/npm/darwin-arm64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@truenine/memory-sync-cli-darwin-arm64",
"version": "2026.10403.117",
"version": "2026.10404.101",
"os": [
"darwin"
],
Expand Down
2 changes: 1 addition & 1 deletion cli/npm/darwin-x64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@truenine/memory-sync-cli-darwin-x64",
"version": "2026.10403.117",
"version": "2026.10404.101",
"os": [
"darwin"
],
Expand Down
2 changes: 1 addition & 1 deletion cli/npm/linux-arm64-gnu/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@truenine/memory-sync-cli-linux-arm64-gnu",
"version": "2026.10403.117",
"version": "2026.10404.101",
"os": [
"linux"
],
Expand Down
2 changes: 1 addition & 1 deletion cli/npm/linux-x64-gnu/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@truenine/memory-sync-cli-linux-x64-gnu",
"version": "2026.10403.117",
"version": "2026.10404.101",
"os": [
"linux"
],
Expand Down
2 changes: 1 addition & 1 deletion cli/npm/win32-x64-msvc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@truenine/memory-sync-cli-win32-x64-msvc",
"version": "2026.10403.117",
"version": "2026.10404.101",
"os": [
"win32"
],
Expand Down
2 changes: 1 addition & 1 deletion cli/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@truenine/memory-sync-cli",
"type": "module",
"version": "2026.10403.117",
"version": "2026.10404.101",
"description": "TrueNine Memory Synchronization CLI shell",
"author": "TrueNine",
"license": "AGPL-3.0-only",
Expand Down
73 changes: 0 additions & 73 deletions cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ pub enum CliCommand {
/// Remove all generated output files and directories
Clean(CleanArgs),

/// Set or show configuration values
Config(ConfigArgs),

/// List all registered plugins
Plugins,
}
Expand All @@ -66,20 +63,6 @@ pub struct CleanArgs {
pub dry_run: bool,
}

#[derive(Args, Debug)]
pub struct ConfigArgs {
/// Show merged configuration as JSON
#[arg(long = "show")]
pub show: bool,

/// Configuration key=value pairs to set
#[arg(long = "set", value_name = "KEY=VALUE")]
pub set: Vec<String>,

/// Positional key=value pairs
pub positional: Vec<String>,
}

/// Resolved log level from CLI flags.
/// When multiple flags are provided, the most verbose wins.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
Expand Down Expand Up @@ -161,34 +144,9 @@ pub enum ResolvedCommand {
DryRun,
Clean,
DryRunClean,
Config(Vec<(String, String)>),
ConfigShow,
Plugins,
}

/// Parse --set and positional key=value pairs into (key, value) tuples.
fn parse_key_value_pairs(args: &ConfigArgs) -> Vec<(String, String)> {
let mut pairs = Vec::new();

for s in &args.set {
if let Some(eq_idx) = s.find('=')
&& eq_idx > 0
{
pairs.push((s[..eq_idx].to_string(), s[eq_idx + 1..].to_string()));
}
}

for s in &args.positional {
if let Some(eq_idx) = s.find('=')
&& eq_idx > 0
{
pairs.push((s[..eq_idx].to_string(), s[eq_idx + 1..].to_string()));
}
}

pairs
}

/// Resolve the command to execute from parsed CLI args.
pub fn resolve_command(cli: &Cli) -> ResolvedCommand {
match &cli.command {
Expand All @@ -203,18 +161,6 @@ pub fn resolve_command(cli: &Cli) -> ResolvedCommand {
ResolvedCommand::Clean
}
}
Some(CliCommand::Config(args)) => {
if args.show {
ResolvedCommand::ConfigShow
} else {
let pairs = parse_key_value_pairs(args);
if pairs.is_empty() {
ResolvedCommand::Execute
} else {
ResolvedCommand::Config(pairs)
}
}
}
Some(CliCommand::Plugins) => ResolvedCommand::Plugins,
}
}
Expand All @@ -235,23 +181,4 @@ mod tests {
let cli = Cli::parse_from(["tnmsc", "clean", "--dry-run"]);
assert_eq!(resolve_command(&cli), ResolvedCommand::DryRunClean);
}

#[test]
fn config_key_value_parsing_combines_flag_and_positional_pairs() {
let cli = Cli::parse_from([
"tnmsc",
"config",
"--set",
"workspaceDir=/tmp/workspace",
"logLevel=debug",
]);

assert_eq!(
resolve_command(&cli),
ResolvedCommand::Config(vec![
("workspaceDir".to_string(), "/tmp/workspace".to_string()),
("logLevel".to_string(), "debug".to_string()),
])
);
}
}
14 changes: 1 addition & 13 deletions cli/src/commands/Command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import type {
OutputCollectedContext,
OutputPlugin,
OutputWriteContext,
PluginOptions,
UserConfigFile
PluginOptions
} from '@truenine/memory-sync-sdk'

export interface CommandContext {
Expand Down Expand Up @@ -35,17 +34,6 @@ export interface PluginExecutionResult {
readonly duration?: number
}

export interface JsonConfigInfo {
readonly merged: UserConfigFile
readonly sources: readonly ConfigSource[]
}

export interface ConfigSource {
readonly path: string
readonly layer: 'programmatic' | 'global' | 'default'
readonly config: Partial<UserConfigFile>
}

export interface JsonPluginInfo {
readonly name: string
readonly kind: 'Input' | 'Output'
Expand Down
150 changes: 0 additions & 150 deletions cli/src/commands/ConfigCommand.ts

This file was deleted.

Loading