From ca9ce518bc403d1aa5f95afeb8f5d9573c2ed781 Mon Sep 17 00:00:00 2001 From: joelazar Date: Thu, 24 Jul 2025 17:04:32 +0200 Subject: [PATCH] :sparkles: Add Fish completion and new AWS cables for television tool - Add tv.fish completion script for cable options - Add cables for aws-elasticache, aws-rds, and aws-secrets - Pipe aws-instances preview output through jq for color --- dot_config/private_fish/completions/tv.fish | 9 +++++++++ dot_config/television/cable/aws-elasticache.toml | 14 ++++++++++++++ dot_config/television/cable/aws-instances.toml | 2 +- dot_config/television/cable/aws-rds.toml | 14 ++++++++++++++ dot_config/television/cable/aws-secrets.toml | 14 ++++++++++++++ 5 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 dot_config/private_fish/completions/tv.fish create mode 100644 dot_config/television/cable/aws-elasticache.toml create mode 100644 dot_config/television/cable/aws-rds.toml create mode 100644 dot_config/television/cable/aws-secrets.toml diff --git a/dot_config/private_fish/completions/tv.fish b/dot_config/private_fish/completions/tv.fish new file mode 100644 index 00000000..21565522 --- /dev/null +++ b/dot_config/private_fish/completions/tv.fish @@ -0,0 +1,9 @@ +function __tv_cable_options + # List all .toml files in the cable directory and strip the .toml extension + for file in (find ~/.config/television/cable -name "*.toml" -type f 2>/dev/null) + basename $file .toml + end +end + +complete --command tv --no-files --arguments "(__tv_cable_options)" --description "Cable options" + diff --git a/dot_config/television/cable/aws-elasticache.toml b/dot_config/television/cable/aws-elasticache.toml new file mode 100644 index 00000000..4398f8cd --- /dev/null +++ b/dot_config/television/cable/aws-elasticache.toml @@ -0,0 +1,14 @@ +[metadata] +name = "aws-elasticache" +description = "A channel to select from AWS ElastiCache clusters" +requirements = ["aws"] + +[source] +command = "aws elasticache describe-cache-clusters --query 'CacheClusters[].[CacheClusterId,Engine,CacheClusterStatus]' --output text" + +[preview] +command = "aws elasticache describe-cache-clusters --cache-cluster-id '{split:\t:0}' --output json | jq -C" + +[ui.preview_panel] +size = 60 + diff --git a/dot_config/television/cable/aws-instances.toml b/dot_config/television/cable/aws-instances.toml index 40881d01..3381554a 100644 --- a/dot_config/television/cable/aws-instances.toml +++ b/dot_config/television/cable/aws-instances.toml @@ -7,7 +7,7 @@ requirements = ["aws"] command = "aws ec2 describe-instances --output text --query \"Reservations[*].Instances[*].[InstanceId,Tags[?Key=='Name']|[0].Value]\"" [preview] -command = "aws ec2 describe-instances --output json --instance-ids {split:\t:0} --query 'Reservations[*].Instances[0]'" +command = "aws ec2 describe-instances --output json --instance-ids {split:\t:0} --query 'Reservations[*].Instances[0]' | jq -C" [ui.preview_panel] size = 60 diff --git a/dot_config/television/cable/aws-rds.toml b/dot_config/television/cable/aws-rds.toml new file mode 100644 index 00000000..51010659 --- /dev/null +++ b/dot_config/television/cable/aws-rds.toml @@ -0,0 +1,14 @@ +[metadata] +name = "aws-rds" +description = "A channel to select from AWS RDS instances" +requirements = ["aws"] + +[source] +command = "aws rds describe-db-instances --query 'DBInstances[].[DBInstanceIdentifier,Engine,DBInstanceStatus]' --output text" + +[preview] +command = "aws rds describe-db-instances --db-instance-identifier '{split:\t:0}' --output json | jq -C" + +[ui.preview_panel] +size = 60 + diff --git a/dot_config/television/cable/aws-secrets.toml b/dot_config/television/cable/aws-secrets.toml new file mode 100644 index 00000000..47e3dc87 --- /dev/null +++ b/dot_config/television/cable/aws-secrets.toml @@ -0,0 +1,14 @@ +[metadata] +name = "aws-secrets" +description = "A channel to select from AWS Secrets Manager secrets" +requirements = ["aws"] + +[source] +command = "aws secretsmanager list-secrets --query 'SecretList[].[Name,Description]' --output text" + +[preview] +command = "aws secretsmanager describe-secret --secret-id '{split:\t:0}' --output json | jq -C" + +[ui.preview_panel] +size = 60 + -- 2.51.2