Skip to content

Commit 3a2f016

Browse files
feat: clean up documentation to focus only on user-facing commands
- Add :nodoc: directives to all internal/implementation modules - Hide Vendor, Core, Exceptions, and MainCommand from public docs - Remove legacy Amber namespace from documentation - Add comprehensive documentation to all CLI commands - Focus documentation on user-facing Commands and Documentation modules - Reduce documentation from 39 to 23 HTML files (41% reduction) Documentation now includes only: - AmberCLI::Commands::* - All user-facing CLI commands with examples - AmberCLI::Documentation::* - Comprehensive guides and references Internal implementation details are completely hidden from public docs while maintaining comprehensive user documentation and examples.
1 parent ce9470a commit 3a2f016

File tree

17 files changed

+218
-4
lines changed

17 files changed

+218
-4
lines changed

src/amber_cli/commands/database.cr

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,37 @@ require "mysql"
44
require "sqlite3"
55
require "../core/base_command"
66
require "../helpers/helpers"
7-
7+
require "../helpers/migration"
8+
require "../config"
9+
require "file_utils"
10+
11+
# The `database` command provides database management operations including
12+
# migrations, seeding, and database status checks.
13+
#
14+
# ## Usage
15+
# ```
16+
# amber database [action] [options]
17+
# ```
18+
#
19+
# ## Actions
20+
# - `migrate` - Run pending migrations
21+
# - `rollback` - Rollback the last migration
22+
# - `seed` - Run database seeds
23+
# - `status` - Show migration status
24+
# - `create` - Create the database
25+
# - `drop` - Drop the database
26+
#
27+
# ## Examples
28+
# ```
29+
# # Run all pending migrations
30+
# amber database migrate
31+
#
32+
# # Rollback the last migration
33+
# amber database rollback
34+
#
35+
# # Check migration status
36+
# amber database status
37+
# ```
838
module AmberCLI::Commands
939
class DatabaseCommand < AmberCLI::Core::BaseCommand
1040
Log = ::Log.for("database")

src/amber_cli/commands/encrypt.cr

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,32 @@
11
require "../core/base_command"
22
require "../exceptions"
33
require "../../support/file_encryptor"
4+
require "../helpers/helpers"
45

6+
# The `encrypt` command manages encrypted environment files for secure
7+
# configuration storage and deployment.
8+
#
9+
# ## Usage
10+
# ```
11+
# amber encrypt [environment] [options]
12+
# ```
13+
#
14+
# ## Actions
15+
# - `encrypt` - Encrypt an environment file
16+
# - `decrypt` - Decrypt an environment file
17+
# - `edit` - Edit an encrypted environment file
18+
#
19+
# ## Examples
20+
# ```
21+
# # Encrypt production environment file
22+
# amber encrypt production
23+
#
24+
# # Edit encrypted staging config
25+
# amber encrypt staging --edit
26+
#
27+
# # Decrypt for debugging
28+
# amber encrypt production --decrypt
29+
# ```
530
module AmberCLI::Commands
631
class EncryptCommand < AmberCLI::Core::BaseCommand
732
getter environment : String = "production"

src/amber_cli/commands/exec.cr

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,31 @@
11
require "../core/base_command"
22
require "file_utils"
3-
3+
require "../helpers/helpers"
4+
5+
# The `exec` command executes Crystal code within the context of your
6+
# Amber application, providing access to models, configuration, and environment.
7+
#
8+
# ## Usage
9+
# ```
10+
# amber exec 'Crystal code here'
11+
# amber exec -f script.cr
12+
# ```
13+
#
14+
# ## Options
15+
# - `-f, --file` - Execute code from a file
16+
# - `-e, --env` - Environment to run in
17+
#
18+
# ## Examples
19+
# ```
20+
# # Execute inline Crystal code
21+
# amber exec 'puts User.count'
22+
#
23+
# # Run a script file
24+
# amber exec -f scripts/data_migration.cr
25+
#
26+
# # Query the database in production
27+
# amber exec -e production 'puts Post.where(published: true).count'
28+
# ```
429
module AmberCLI::Commands
530
class ExecCommand < AmberCLI::Core::BaseCommand
631
getter code : String = ""

src/amber_cli/commands/new.cr

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
require "../core/base_command"
22

3+
# The `new` command creates a new Amber application with a default directory structure
4+
# and configuration at the specified path.
5+
#
6+
# ## Usage
7+
# ```
8+
# amber new [app_name] -d [pg | mysql | sqlite] -t [slang | ecr] --no-deps
9+
# ```
10+
#
11+
# ## Options
12+
# - `-d, --database` - Database type (pg, mysql, sqlite)
13+
# - `-t, --template` - Template language (slang, ecr)
14+
# - `--no-deps` - Skip dependency installation
15+
#
16+
# ## Examples
17+
# ```
18+
# # Create a new app with PostgreSQL and Slang
19+
# amber new my_blog -d pg -t slang
20+
#
21+
# # Create app with SQLite (for development)
22+
# amber new quick_app -d sqlite
23+
# ```
324
module AmberCLI::Commands
425
class NewCommand < AmberCLI::Core::BaseCommand
526
getter database : String = "pg"

src/amber_cli/commands/pipelines.cr

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
require "../core/base_command"
22

3+
# The `pipelines` command displays and manages HTTP request pipelines
4+
# configured in your Amber application.
5+
#
6+
# ## Usage
7+
# ```
8+
# amber pipelines [options]
9+
# ```
10+
#
11+
# ## Options
12+
# - `--json` - Output pipelines in JSON format
13+
# - `--verbose` - Show detailed pipeline information
14+
#
15+
# ## Examples
16+
# ```
17+
# # Show all configured pipelines
18+
# amber pipelines
19+
#
20+
# # Export pipeline configuration as JSON
21+
# amber pipelines --json
22+
#
23+
# # Show detailed pipeline information
24+
# amber pipelines --verbose
25+
# ```
326
module AmberCLI::Commands
427
class PipelinesCommand < AmberCLI::Core::BaseCommand
528
getter result = Array(NamedTuple(pipes: Array(String), plugs: Array(String))).new

src/amber_cli/commands/plugin.cr

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,31 @@
11
require "../core/base_command"
22
require "../plugins/plugin"
33

4+
# The `plugin` command manages Amber CLI plugins for extending functionality
5+
# with custom generators, commands, and integrations.
6+
#
7+
# ## Usage
8+
# ```
9+
# amber plugin [action] [name] [options]
10+
# ```
11+
#
12+
# ## Actions
13+
# - `install` - Install a plugin from a repository
14+
# - `uninstall` - Remove an installed plugin
15+
# - `list` - Show installed plugins
16+
# - `search` - Search available plugins
17+
#
18+
# ## Examples
19+
# ```
20+
# # Install a plugin from GitHub
21+
# amber plugin install myorg/amber-plugin-api
22+
#
23+
# # List all installed plugins
24+
# amber plugin list
25+
#
26+
# # Uninstall a plugin
27+
# amber plugin uninstall amber-plugin-api
28+
# ```
429
module AmberCLI::Commands
530
class PluginCommand < AmberCLI::Core::BaseCommand
631
getter plugin_name : String = ""

src/amber_cli/commands/routes.cr

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,29 @@
11
require "../core/base_command"
22
require "json"
3-
3+
require "../helpers/helpers"
4+
5+
# The `routes` command displays all defined routes in your Amber application.
6+
#
7+
# ## Usage
8+
# ```
9+
# amber routes [options]
10+
# ```
11+
#
12+
# ## Options
13+
# - `--json` - Output routes in JSON format
14+
# - `--filter` - Filter routes by pattern
15+
#
16+
# ## Examples
17+
# ```
18+
# # Show all routes in table format
19+
# amber routes
20+
#
21+
# # Export routes as JSON
22+
# amber routes --json
23+
#
24+
# # Filter routes containing "api"
25+
# amber routes --filter api
26+
# ```
427
module AmberCLI::Commands
528
class RoutesCommand < AmberCLI::Core::BaseCommand
629
RESOURCE_ROUTE_REGEX = /(\w+)\s+\"([^\"]+)\",\s*([\w:]+)(?:,\s*(\w+)\:\s*\[([^\]]+)\])?/

src/amber_cli/commands/watch.cr

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,31 @@
11
require "../core/base_command"
22
require "../helpers/process_runner"
3-
3+
require "../helpers/sentry"
4+
5+
# The `watch` command starts a development server that automatically reloads
6+
# your application when source files change.
7+
#
8+
# ## Usage
9+
# ```
10+
# amber watch [options]
11+
# ```
12+
#
13+
# ## Options
14+
# - `-p, --port` - Port to run the server on (default: 3000)
15+
# - `-e, --env` - Environment to run in (development, production)
16+
# - `-v, --verbose` - Enable verbose output
17+
#
18+
# ## Examples
19+
# ```
20+
# # Start development server with auto-reload
21+
# amber watch
22+
#
23+
# # Run on specific port
24+
# amber watch -p 8080
25+
#
26+
# # Watch with verbose output
27+
# amber watch -v
28+
# ```
429
module AmberCLI::Commands
530
class WatchCommand < AmberCLI::Core::BaseCommand
631
getter name : String = ""

src/amber_cli/core/base_command.cr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# :nodoc:
22
require "option_parser"
33

4+
# :nodoc:
45
module AmberCLI::Core
56
abstract class BaseCommand
67
getter option_parser : OptionParser

src/amber_cli/core/configurable_generator_manager.cr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ require "./template_engine"
44
require "./word_transformer"
55
require "../exceptions"
66

7+
# :nodoc:
78
module AmberCLI::Core
89
class ConfigurableGeneratorManager
910
@config : GeneratorConfig

0 commit comments

Comments
 (0)