Compare commits

...
7 changed files with 3094 additions and 3010 deletions

No files matched your search

+3 -1
View File
@@ -148,8 +148,10 @@ jobs:
token: ${{ steps.app-token.outputs.token }}
- name: Update latest tag
env:
TAG_NAME: ${{ needs.release-please.outputs.tag_name }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -fa latest -m "Latest stable release (${{ needs.release-please.outputs.tag_name }})"
git tag -fa latest -m "Latest stable release ($TAG_NAME)"
git push origin latest --force
+8
View File
@@ -11,6 +11,14 @@ readme = "README.md"
keywords = ["cli", "llm", "token", "filter", "productivity"]
categories = ["command-line-utilities", "development-tools"]
[lib]
name = "rtk"
path = "src/lib.rs"
[[bin]]
name = "rtk"
path = "src/main.rs"
[dependencies]
clap = { version = "4", features = ["derive"] }
anyhow = "1.0"
+11 -16
View File
@@ -11,7 +11,11 @@ use crate::parser::{
emit_degradation_warning, emit_passthrough_warning, extract_json_object, truncate_passthrough,
FormatMode, OutputParser, ParseResult, TestFailure, TestResult, TokenFormatter,
};
use crate::Commands;
/// Which JS test framework to run.
pub enum JsTestFramework {
Vitest,
Jest,
}
/// Vitest JSON output structures (tool-specific format)
#[derive(Debug, Deserialize)]
@@ -204,31 +208,22 @@ fn extract_failures_regex(output: &str) -> Vec<TestFailure> {
failures
}
pub fn run_test(command: &Commands, args: &[String], verbose: u8) -> Result<i32> {
pub fn run_test(fw: JsTestFramework, args: &[String], verbose: u8) -> Result<i32> {
let timer = tracking::TimedExecution::start();
let (framework, mut cmd) = match command {
Commands::Vitest { .. } => {
let (framework, mut cmd) = match fw {
JsTestFramework::Vitest => {
let framework = "vitest";
let mut cmd = package_manager_exec(framework);
cmd
// Force non-watch mode
.arg("run")
// Enable JSON structured output
.arg("--reporter=json");
cmd.arg("run").arg("--reporter=json");
(framework, cmd)
}
Commands::Jest { .. } => {
JsTestFramework::Jest => {
let framework = "jest";
let mut cmd = package_manager_exec(framework);
cmd
// Force non-watch mode
.arg("--no-watch")
// Enable JSON structured output
.arg("--json");
cmd.arg("--no-watch").arg("--json");
(framework, cmd)
}
_ => unreachable!(),
};
for arg in args {
+1 -1
View File
@@ -1293,7 +1293,7 @@ pub fn estimate_tokens(text: &str) -> usize {
///
/// # Examples
///
/// ```no_run
/// ```ignore
/// use rtk::tracking::TimedExecution;
///
/// let timer = TimedExecution::start();
+3019
View File
File diff suppressed because it is too large. Load diff
+51
View File
@@ -0,0 +1,51 @@
//! RTK (Rust Token Killer) library crate.
//!
//! Re-exports all public modules for use by downstream crates (e.g. rtk-pro).
//! The binary crate (`main.rs`) uses its own `mod` declarations to compile the
//! same source files independently.
pub mod analytics;
pub mod cmds;
pub mod core;
pub mod discover;
pub mod dispatch;
pub mod hooks;
pub mod learn;
pub mod parser;
// Re-export command modules (mirrors main.rs use statements)
pub use cmds::cloud::{aws_cmd, container, curl_cmd, psql_cmd, wget_cmd};
pub use cmds::dotnet::{binlog, dotnet_cmd, dotnet_format_report, dotnet_trx};
pub use cmds::git::{diff_cmd, gh_cmd, git, glab_cmd, gt_cmd};
pub use cmds::go::{go_cmd, golangci_cmd};
pub use cmds::js::{
lint_cmd, next_cmd, npm_cmd, playwright_cmd, pnpm_cmd, prettier_cmd, prisma_cmd, tsc_cmd,
vitest_cmd,
};
pub use cmds::python::{mypy_cmd, pip_cmd, pytest_cmd, ruff_cmd};
pub use cmds::ruby::{rake_cmd, rspec_cmd, rubocop_cmd};
pub use cmds::rust::cargo_cmd;
pub use cmds::rust::runner as cargo_runner;
pub use cmds::system::{
deps, env_cmd, find_cmd, format_cmd, grep_cmd, json_cmd, local_llm, log_cmd, ls, pipe_cmd,
read, summary, tree, wc_cmd,
};
// Re-export core modules
pub use self::core::{
config, constants, display_helpers, filter, runner, stream, tee, telemetry, telemetry_cmd,
toml_filter, tracking, utils,
};
// Re-export analytics
pub use analytics::{cc_economics, ccusage, gain, session_cmd};
// Re-export hooks
pub use hooks::{
hook_audit_cmd, hook_check, hook_cmd, init, integrity, permissions, rewrite_cmd, trust,
verify_cmd,
};
// Re-export dispatch entry point for downstream crates (rtk-pro)
pub use dispatch::oss_command_names;
pub use dispatch::run_from_args;
+1 -2992
View File
File diff suppressed because it is too large. Load diff