1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
pub mod add;
pub mod build;
pub mod deploy;
pub mod dev;
pub mod fe_runtime;
pub mod init;
pub mod queue;
use clap::{Parser, Subcommand};
use std::path::PathBuf;
#[derive(Parser)]
#[command(name = "forte")]
#[command(about = "Forte - Fullstack Framework", long_about = None)]
pub struct Cli {
#[command(subcommand)]
pub command: Commands,
}
#[derive(Subcommand)]
pub enum Commands {
/// Start the development server with hot reload
Dev {
/// Project directory (defaults to current directory)
#[arg(short, long)]
project: Option<PathBuf>,
/// Port to listen on (auto-selects from 3000 if not specified)
#[arg(short = 'P', long)]
port: Option<u16>,
},
/// Initialize a new Forte project
Init {
/// Project name
name: String,
},
/// Add a new page or action
Add {
#[command(subcommand)]
command: AddCommands,
},
/// Build the project locally without deploying
Build {
/// Project directory (defaults to current directory)
#[arg(short, long)]
project: Option<PathBuf>,
},
/// Build and deploy the project to fn0 cloud
Deploy {
/// Project directory (defaults to current directory)
#[arg(short, long)]
project: Option<PathBuf>,
},
/// Queue management commands
Queue {
#[command(subcommand)]
command: QueueCommands,
},
}
#[derive(Subcommand)]
pub enum QueueCommands {
/// Flush dead queue tasks back to pending
Flush {
/// Project directory (defaults to current directory)
#[arg(short, long)]
project: Option<PathBuf>,
/// Only flush tasks with this name
#[arg(short, long)]
task_name: Option<String>,
},
}
#[derive(Subcommand)]
pub enum AddCommands {
/// Add a new page
Page {
/// Page path (e.g., "product/[id]")
path: String,
},
/// Add a new action
Action {
/// Action path (e.g., "user/login")
path: String,
},
}