@icarusmx/creta 1.5.12 → 1.5.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/creta.js +31 -1
- package/lib/data/command-help/aws-ec2.js +34 -0
- package/lib/data/command-help/grep.js +76 -0
- package/lib/data/command-help/index.js +11 -1
- package/lib/data/command-help/lz.js +57 -0
- package/lib/executors/CommandHelpExecutor.js +6 -1
- package/lib/exercises/.claude/settings.local.json +12 -0
- package/lib/exercises/01-developing-muscle-for-nvim.md +528 -0
- package/lib/exercises/{iterm2-pane-navigation.md → 02-iterm2-pane-navigation.md} +1 -1
- package/lib/exercises/05-svelte-first-steps.md +1340 -0
- package/lib/exercises/{curl-and-pipes.md → 06-curl-and-pipes.md} +187 -72
- package/lib/exercises/07-claude-api-first-steps.md +855 -0
- package/lib/exercises/08-playwright-svelte-guide.md +1384 -0
- package/lib/exercises/09-docker-first-steps.md +1475 -0
- package/lib/exercises/{railway-deployment.md → 10-railway-deployment.md} +1 -0
- package/lib/exercises/{aws-billing-detective.md → 11-aws-billing-detective.md} +215 -35
- package/lib/exercises/12-install-skills.md +755 -0
- package/lib/exercises/13-shell-aliases.md +134 -0
- package/lib/exercises/README.md +187 -0
- package/lib/exercises/utils/booklet-2up.js +133 -0
- package/lib/exercises/utils/booklet-manual-duplex.js +159 -0
- package/lib/exercises/utils/booklet-simple.js +136 -0
- package/lib/exercises/utils/create-booklet.js +116 -0
- package/lib/scripts/aws-ec2-all.sh +58 -0
- package/package.json +3 -2
- /package/lib/exercises/{git-stash-workflow.md → 03-git-stash-workflow.md} +0 -0
- /package/lib/exercises/{array-object-manipulation.md → 04-array-object-manipulation.md} +0 -0
package/bin/creta.js
CHANGED
|
@@ -139,6 +139,34 @@ if (command.startsWith('portafolio')) {
|
|
|
139
139
|
// Show AWS billing detective guide
|
|
140
140
|
const viewer = new AWSGuideViewer()
|
|
141
141
|
await viewer.start()
|
|
142
|
+
} else if (command === 'aws-ec2') {
|
|
143
|
+
const subcommand = args[1]
|
|
144
|
+
|
|
145
|
+
if (subcommand === 'all') {
|
|
146
|
+
// Execute the AWS EC2 audit script
|
|
147
|
+
showLogo()
|
|
148
|
+
console.log('🔍 Ejecutando auditoría de EC2 y volúmenes EBS en todas las regiones...\n')
|
|
149
|
+
|
|
150
|
+
const __filename = fileURLToPath(import.meta.url)
|
|
151
|
+
const __dirname = path.dirname(__filename)
|
|
152
|
+
const scriptPath = path.join(__dirname, '../lib/scripts/aws-ec2-all.sh')
|
|
153
|
+
|
|
154
|
+
try {
|
|
155
|
+
execSync(`bash "${scriptPath}"`, { stdio: 'inherit' })
|
|
156
|
+
} catch (error) {
|
|
157
|
+
console.error('\n❌ Error ejecutando el script:', error.message)
|
|
158
|
+
console.log('\n💡 Asegúrate de tener AWS CLI configurado: aws configure')
|
|
159
|
+
}
|
|
160
|
+
} else if (subcommand === 'help' || !subcommand) {
|
|
161
|
+
// Show help via CommandHelpExecutor
|
|
162
|
+
const executor = new CommandHelpExecutor(['aws-ec2'])
|
|
163
|
+
await executor.execute()
|
|
164
|
+
} else {
|
|
165
|
+
console.log(`❌ Subcomando no reconocido: ${subcommand}`)
|
|
166
|
+
console.log('\nComandos disponibles:')
|
|
167
|
+
console.log(' creta aws-ec2 all - Audita todas las regiones')
|
|
168
|
+
console.log(' creta aws-ec2 help - Muestra ayuda')
|
|
169
|
+
}
|
|
142
170
|
} else if (command === 'reset') {
|
|
143
171
|
// Reset user state with confirmation
|
|
144
172
|
const rl = createInterface({ input: process.stdin, output: process.stdout })
|
|
@@ -652,6 +680,8 @@ function showHelp() {
|
|
|
652
680
|
|
|
653
681
|
console.log("📖 Documentación de comandos:")
|
|
654
682
|
console.log(" creta ls - Documentación en español del comando ls")
|
|
683
|
+
console.log(" creta grep - Documentación en español del comando grep")
|
|
684
|
+
console.log(" creta lz - Localiza recursos (alias de curl)")
|
|
655
685
|
console.log(" creta cd - Documentación en español del comando cd")
|
|
656
686
|
console.log(" creta curl - Documentación en español del comando curl")
|
|
657
687
|
console.log(" creta git status - Documentación en español de git status")
|
|
@@ -1875,7 +1905,7 @@ async function startVimSetupTutorial() {
|
|
|
1875
1905
|
// Helper function to detect command help requests
|
|
1876
1906
|
function isCommandHelpRequest(args) {
|
|
1877
1907
|
// List of supported commands for help
|
|
1878
|
-
const basicCommands = ['ls', 'cd', 'mkdir', 'touch', 'wc', 'curl']
|
|
1908
|
+
const basicCommands = ['ls', 'cd', 'mkdir', 'touch', 'wc', 'curl', 'grep', 'lz']
|
|
1879
1909
|
const gitCommands = ['git status', 'git add', 'git commit', 'git push', 'git log']
|
|
1880
1910
|
|
|
1881
1911
|
const commandString = args.join(' ')
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export const awsEc2 = {
|
|
2
|
+
command: 'aws-ec2',
|
|
3
|
+
description: 'Herramienta para auditar instancias EC2 y volúmenes EBS en AWS - encuentra recursos olvidados que te están costando dinero',
|
|
4
|
+
usage: 'creta aws-ec2 [comando]',
|
|
5
|
+
commonOptions: [
|
|
6
|
+
{
|
|
7
|
+
flag: 'all',
|
|
8
|
+
description: 'Escanea TODAS las regiones de AWS buscando instancias EC2 y volúmenes EBS'
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
flag: 'help',
|
|
12
|
+
description: 'Muestra esta ayuda'
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
examples: [
|
|
16
|
+
{
|
|
17
|
+
command: 'creta aws-ec2 all',
|
|
18
|
+
description: 'Audita todas las regiones - encuentra instancias y volúmenes que no conocías'
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
command: 'creta aws-ec2 help',
|
|
22
|
+
description: 'Muestra esta documentación'
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
relatedLesson: 'AWS Billing Detective',
|
|
26
|
+
tips: [
|
|
27
|
+
'Este comando puede tardar 1-2 minutos - está escaneando ~20 regiones',
|
|
28
|
+
'Volúmenes AVAILABLE (no attached) = DINERO DESPERDICIADO cada mes',
|
|
29
|
+
'Si encuentras instancias corriendo que no conocías, ¡apágalas!',
|
|
30
|
+
'Pro tip: ejecuta esto mensualmente para evitar cargos sorpresa en tu bill de AWS',
|
|
31
|
+
'Requiere que tengas AWS CLI configurado: aws configure',
|
|
32
|
+
'El script destaca los volúmenes "AVAILABLE" porque esos son los que te cuestan sin usarlos'
|
|
33
|
+
]
|
|
34
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
export const grep = {
|
|
2
|
+
command: 'grep',
|
|
3
|
+
description: 'Busca patrones de texto en archivos o entrada de texto',
|
|
4
|
+
usage: 'grep [opciones] "patrón" [archivo(s)]',
|
|
5
|
+
commonOptions: [
|
|
6
|
+
{
|
|
7
|
+
flag: '-i',
|
|
8
|
+
description: 'Ignora mayúsculas/minúsculas (case insensitive)'
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
flag: '-r',
|
|
12
|
+
description: 'Búsqueda recursiva en carpetas'
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
flag: '-n',
|
|
16
|
+
description: 'Muestra números de línea'
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
flag: '-v',
|
|
20
|
+
description: 'Invierte búsqueda (muestra líneas que NO coinciden)'
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
flag: '-c',
|
|
24
|
+
description: 'Cuenta líneas que coinciden'
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
flag: '-q',
|
|
28
|
+
description: 'Modo silencioso (no imprime nada, solo devuelve código de salida)'
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
flag: '-l',
|
|
32
|
+
description: 'Solo muestra nombres de archivos con coincidencias'
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
flag: '-A',
|
|
36
|
+
description: 'Muestra N líneas DESPUÉS de la coincidencia'
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
flag: '-B',
|
|
40
|
+
description: 'Muestra N líneas ANTES de la coincidencia'
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
examples: [
|
|
44
|
+
{
|
|
45
|
+
command: 'grep "error" app.log',
|
|
46
|
+
description: 'Busca la palabra "error" en el archivo app.log'
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
command: 'grep -i "warning" *.log',
|
|
50
|
+
description: 'Busca "warning" ignorando mayúsculas en todos los .log'
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
command: 'grep -r "TODO" src/',
|
|
54
|
+
description: 'Busca "TODO" recursivamente en la carpeta src/'
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
command: 'grep -n "function" script.js',
|
|
58
|
+
description: 'Busca "function" y muestra números de línea'
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
command: 'grep -c "import" *.js',
|
|
62
|
+
description: 'Cuenta cuántas líneas tienen "import" en cada .js'
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
command: 'grep -v "test" file.txt',
|
|
66
|
+
description: 'Muestra todas las líneas que NO contienen "test"'
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
relatedLesson: 'Pipes y redirecciones',
|
|
70
|
+
tips: [
|
|
71
|
+
'Pro tip: combina con pipes → `cat file.log | grep "error" | wc -l`',
|
|
72
|
+
'Usa comillas dobles para buscar frases: `grep "syntax error" file.js`',
|
|
73
|
+
'grep -r es tu amigo: busca en todo un proyecto rápidamente',
|
|
74
|
+
'Combina -A y -B para contexto: `grep -A 3 -B 2 "error"` muestra líneas alrededor'
|
|
75
|
+
]
|
|
76
|
+
}
|
|
@@ -5,6 +5,8 @@ export { mkdir } from './mkdir.js'
|
|
|
5
5
|
export { touch } from './touch.js'
|
|
6
6
|
export { wc } from './wc.js'
|
|
7
7
|
export { curl } from './curl.js'
|
|
8
|
+
export { grep } from './grep.js'
|
|
9
|
+
export { lz } from './lz.js'
|
|
8
10
|
|
|
9
11
|
// Git commands
|
|
10
12
|
export { gitStatus } from './git-status.js'
|
|
@@ -13,6 +15,9 @@ export { gitCommit } from './git-commit.js'
|
|
|
13
15
|
export { gitPush } from './git-push.js'
|
|
14
16
|
export { gitLog } from './git-log.js'
|
|
15
17
|
|
|
18
|
+
// AWS commands
|
|
19
|
+
export { awsEc2 } from './aws-ec2.js'
|
|
20
|
+
|
|
16
21
|
// Command mapping for lookup
|
|
17
22
|
export const commandMap = {
|
|
18
23
|
// Basic
|
|
@@ -22,11 +27,16 @@ export const commandMap = {
|
|
|
22
27
|
'touch': 'touch',
|
|
23
28
|
'wc': 'wc',
|
|
24
29
|
'curl': 'curl',
|
|
30
|
+
'grep': 'grep',
|
|
31
|
+
'lz': 'lz',
|
|
25
32
|
|
|
26
33
|
// Git
|
|
27
34
|
'git status': 'gitStatus',
|
|
28
35
|
'git add': 'gitAdd',
|
|
29
36
|
'git commit': 'gitCommit',
|
|
30
37
|
'git push': 'gitPush',
|
|
31
|
-
'git log': 'gitLog'
|
|
38
|
+
'git log': 'gitLog',
|
|
39
|
+
|
|
40
|
+
// AWS
|
|
41
|
+
'aws-ec2': 'awsEc2'
|
|
32
42
|
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export const lz = {
|
|
2
|
+
command: 'lz',
|
|
3
|
+
description: 'Localiza un recurso en la web (alias didáctico de curl)',
|
|
4
|
+
usage: 'lz [url]',
|
|
5
|
+
commonOptions: [
|
|
6
|
+
{
|
|
7
|
+
flag: '-O',
|
|
8
|
+
description: 'Guarda el archivo con su nombre original'
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
flag: '-o archivo',
|
|
12
|
+
description: 'Guarda el contenido en el archivo especificado'
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
flag: '-L',
|
|
16
|
+
description: 'Sigue redirecciones automáticamente'
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
flag: '-I',
|
|
20
|
+
description: 'Solo muestra los headers (encabezados)'
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
flag: '-s',
|
|
24
|
+
description: 'Modo silencioso (no muestra progreso)'
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
examples: [
|
|
28
|
+
{
|
|
29
|
+
command: 'lz icarus.mx/README.md',
|
|
30
|
+
description: 'Localiza y muestra el contenido del README'
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
command: 'lz -O icarus.mx/logo.png',
|
|
34
|
+
description: 'Descarga logo.png con su nombre original'
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
command: 'lz -o mi-archivo.json api.ejemplo.com/data',
|
|
38
|
+
description: 'Guarda la respuesta en mi-archivo.json'
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
command: 'lz -I icarus.mx',
|
|
42
|
+
description: 'Muestra solo los headers del sitio'
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
command: 'lz -sL api.ejemplo.com | grep "version"',
|
|
46
|
+
description: 'Busca "version" en la respuesta (silencioso + sigue redirects)'
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
relatedLesson: 'Curl y pipes',
|
|
50
|
+
tips: [
|
|
51
|
+
'🧠 lz = "localiza recurso" - Alias en español para curl',
|
|
52
|
+
'curl significa "Client URL" - Cliente para Localizar Recursos Universales',
|
|
53
|
+
'Lo "universal" viene del protocolo HTTP (HyperText Transfer Protocol)',
|
|
54
|
+
'En la terminal real usa curl, pero lz te ayuda a pensar en español',
|
|
55
|
+
'Pro tip: lz es perfecto para probar APIs rápidamente'
|
|
56
|
+
]
|
|
57
|
+
}
|
|
@@ -79,15 +79,20 @@ export class CommandHelpExecutor {
|
|
|
79
79
|
console.log('')
|
|
80
80
|
|
|
81
81
|
console.log(chalk.bold(' Básicos:'))
|
|
82
|
-
console.log(chalk.cyan(' ls, cd, mkdir, touch, wc'))
|
|
82
|
+
console.log(chalk.cyan(' ls, cd, mkdir, touch, wc, curl'))
|
|
83
83
|
console.log('')
|
|
84
84
|
|
|
85
85
|
console.log(chalk.bold(' Git:'))
|
|
86
86
|
console.log(chalk.cyan(' git status, git add, git commit, git push, git log'))
|
|
87
87
|
console.log('')
|
|
88
88
|
|
|
89
|
+
console.log(chalk.bold(' AWS:'))
|
|
90
|
+
console.log(chalk.cyan(' aws-ec2'))
|
|
91
|
+
console.log('')
|
|
92
|
+
|
|
89
93
|
console.log(chalk.dim('💡 Ejemplo: creta ls'))
|
|
90
94
|
console.log(chalk.dim('💡 Ejemplo: creta git status'))
|
|
95
|
+
console.log(chalk.dim('💡 Ejemplo: creta aws-ec2'))
|
|
91
96
|
console.log('')
|
|
92
97
|
}
|
|
93
98
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Read(//Users/guillermo/icarus/creta/cli/bin/**)",
|
|
5
|
+
"Read(//Users/guillermo/icarus/creta/cli/**)",
|
|
6
|
+
"Bash(chmod:*)",
|
|
7
|
+
"Bash(/Users/guillermo/icarus/creta/cli/lib/exercises/test-curl-examples.sh)"
|
|
8
|
+
],
|
|
9
|
+
"deny": [],
|
|
10
|
+
"ask": []
|
|
11
|
+
}
|
|
12
|
+
}
|