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
96 changes: 95 additions & 1 deletion Cargo.lock

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

6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,16 @@ rand = "0.8"
sha2 = "0.10"
tiny_http = "0.12"
comfy-table = "7"
flate2 = "1"
tar = "0.4"
semver = "1"

[package.metadata.release]
pre-release-hook = ["git", "cliff", "-o", "CHANGELOG.md", "--tag", "{{version}}" ]
publish = false
pre-release-replacements = [
{ file = "skills/hotdata-cli/SKILL.md", search = "^version: .+", replace = "version: {{version}}", exactly = 1 },
]

# The profile that 'dist' will build with
[profile.dist]
Expand Down
4 changes: 4 additions & 0 deletions dist-workspace.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ install-path = "~/.hotdata/cli"
publish-jobs = ["homebrew"]
# Whether to install an updater program
install-updater = false

[[dist.extra-artifacts]]
artifacts = ["skills.tar.gz"]
build = ["tar", "-czf", "skills.tar.gz", "skills/"]
2 changes: 1 addition & 1 deletion skills/hotdata-cli/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: hotdata-cli
description: Use this skill when the user wants to run hotdata CLI commands, query the HotData API, list workspaces, list connections, list tables, execute SQL queries, or interact with the hotdata service. Activate when the user says "run hotdata", "query hotdata", "list workspaces", "list connections", "list tables", "execute a query", or asks you to use the hotdata CLI.
version: 1.0.0
version: 0.1.3
---

# HotData CLI Skill
Expand Down
18 changes: 18 additions & 0 deletions src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ pub enum Commands {
command: TablesCommands,
},

/// Manage the hotdata-cli agent skill
Skill {
#[command(subcommand)]
command: SkillCommands,
},

/// Retrieve a stored query result by ID
Results {
/// Result ID
Expand Down Expand Up @@ -428,6 +434,18 @@ pub enum ConnectionsCommands {
},
}

#[derive(Subcommand)]
pub enum SkillCommands {
/// Install or update the hotdata-cli skill into agent directories
Install {
/// Install into the current project directory instead of globally
#[arg(long)]
project: bool,
},
/// Show the installation status of the hotdata-cli skill
Status,
}

#[derive(Subcommand)]
pub enum TablesCommands {
/// List all tables in a workspace
Expand Down
9 changes: 8 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ mod connections;
mod init;
mod query;
mod results;
mod skill;
mod tables;
mod util;
mod workspace;

use anstyle::AnsiColor;
use clap::{Parser, builder::Styles};
use command::{AuthCommands, Commands, ConnectionsCommands, TablesCommands, WorkspaceCommands};
use command::{AuthCommands, Commands, ConnectionsCommands, SkillCommands, TablesCommands, WorkspaceCommands};

#[derive(Parser)]
#[command(name = "hotdata", version, about = concat!("HotData CLI - Command line interface for HotData (v", env!("CARGO_PKG_VERSION"), ")"), long_about = None, disable_version_flag = true)]
Expand Down Expand Up @@ -82,6 +83,12 @@ fn main() {
tables::list(&workspace_id, connection_id.as_deref(), schema.as_deref(), table.as_deref(), limit, cursor.as_deref(), &format)
}
},
Commands::Skill { command } => match command {
SkillCommands::Install { project } => {
if project { skill::install_project() } else { skill::install() }
}
SkillCommands::Status => skill::status(),
},
Commands::Results { result_id, workspace_id, format } => {
let workspace_id = resolve_workspace(workspace_id);
results::get(&result_id, &workspace_id, &format)
Expand Down
Loading