dartisan_cli library
dartisan command runner and built-in commands (BLUEPRINT_V2 §8).
Tier 0 ships the project-bound runner: an application's bin/dartisan.dart
passes its createApp factory to DartisanRunner.
Classes
- AboutCommand
-
dartisan about— summarizes the application environment. - AccessorPlan
- Result of rendering the accessor region.
- AdoptCommand
-
adopt <laravel-path> [--check]— prepares this project to run next to an existing Laravel application on the same database: copies the shared settings from its.envand checks that coexistence will work. The Laravel project is only read, never changed. - AuditCheck
-
One check of the audit: an id for SARIF and
--only, what it looks for, and how to fix what it finds. - AuditFinding
- Something a check found on the target.
- AuditResult
- The audit's outcome: every check run, what each found, and the checks skipped with the reason.
- BuildCommand
-
build [--output] [--with-cli] [--docker]— native app bundle and optional Dockerfile. - CacheClearCommand
-
cache:clear [store]— flushes the default (or named) cache store. - ClientFlutterCommand
-
client:flutter [--output=../app_client] [--package-name=app_client]: generates a typed Dart client package (Flutter and plain Dart) from the application's routes (Blueprint #25). - ClientWatcher
-
client:flutter --watch: regenerates the client when routes, requests, resources or.envchange. The route table is compiled into the running process, so each run is a freshdartisan client:flutter(regenerate); runs never overlap, and changes made during one start another. - CoordinatorReport
-
The coordinator's state as a running server reports it on
/metrics(Prometheus text), read back forcoordinator:stats --url. - CoordinatorStatsCommand
-
coordinator:stats [--url=http://host:8000/metrics] [--token=...]: the running server's coordinator, read from its/metrics: queue, refused calls, round trips by service (p50/p99) and what to do about them. Without--urlit shows this process's own coordinator, which only says something inside a long-running command. - DaragicExportCommand
-
daragic:export [--out=dam] [--only=routes,models,...]: writes the application's DAM (dam.json) anddaragic.lock. - DaravelCommand
- Base class for commands that need the project application.
- DartisanRunner
- Command runner wired to a project's application factory.
- DatabaseTransfer
-
Copies the rows of source into target (
dartisan db:transfer). - DbBackupCommand
-
db:backup [--output] [--keep=N]: a hot backup of the SQLite database intostorage/backups/(schedule it withschedule.command('db:backup', ['--keep=14']).dailyAt('02:00')). - DbInstallCommand
-
db:install <driver>: adds a database driver package to the project, registers it inbootstrap/app.dartand documents its.envkeys. - DbReplicasCommand
-
db:replicas: the generations of the database's replica. - DbReplicateCommand
-
db:replicate: ships the SQLite database to a disk continuously (SqliteReplicator, Blueprint #30) until stopped. - DbRestoreCommand
-
db:restore: rebuilds the SQLite database from its replica. - DbSeedCommand
-
dartisan db:seed [--class=Name] [--all]— runs database seeders. - DbShowCommand
-
db:show— lists the tables of the default connection. - DbTableCommand
-
db:table <table> [--limit=N]— shows the columns of a table and, with--limit, its first rows. - DbTransferCommand
-
db:transfer --from=<connection> --to=<connection>: copies an application's data to another database (SQLite to PostgreSQL, ...). - DevServer
-
dartisan serve --watch: runsbin/server.dartin a child VM with the VM service enabled, watches the project and hot-reloads (or restarts). - DoctorCheck
- DoctorCommand
-
doctor [--production]— environment and configuration pre-flight. - DownCommand
-
down [--secret] [--with-secret] [--retry] [--refresh] [--status] [--except]— puts the application in maintenance mode (Laravel'sstorage/framework/down). Running servers notice within a second. - DriverPackage
-
A database driver package
db:installcan add. - E2eInstallCommand
-
e2e:install [--force]: writes the Playwright suite totests/e2e. - EnvDecryptCommand
-
env:decrypt [--key] [--env] [--filename] [--path] [--force]— writes the plain file back, compatible withphp artisan env:decrypt. - EnvEncryptCommand
-
env:encrypt [--key] [--cipher] [--env] [--readable] [--prune] [--force]— writes.env.encrypted, compatible withphp artisan env:encrypt. - EnvObfuscateCommand
-
env:obfuscate [--env] [--output] [--class] [--only]— writes a Dart file holding the values XOR-masked with random bytes, so they do not appear as plain strings in a compiled binary. - FrameworkSource
-
Where the framework packages come from in a generated
pubspec.yaml. - GeneratedClient
- A generated client: files by path relative to the package root.
- GeneratedFile
- Result of a generation step.
- Generator
- Writes generated files and keeps registries in sync.
- GitSource
-
Git dependency on github.com/daravel-dev/daravel (
--source=git). - GlobalDartisanRunner
-
Global
dartisan(dart pub global activate dartisan_cli). - KeyGenerateCommand
-
key:generate [--show] [--force]— writes a freshAPP_KEYto.env. - LintCommand
-
lint [--json]— runsdaravel_lintsover the project. - MakeCommand
-
Base for
make:*commands: no application boot needed. - MakeConsoleCommand
-
make:command Name [--command=app:name] - MakeControllerCommand
-
make:controller Name [--api] [--resource] [--model=] - MakeE2eCommand
-
make:e2e <Name> [--api]: a new spec intests/e2e/specs. - MakeFactoryCommand
-
make:factory Name [--model=] - MakeJobCommand
-
make:job Name - MakeMiddlewareCommand
-
make:middleware Name - MakeMigrationCommand
-
make:migration name [--create=table] [--table=table] - MakeModelCommand
-
make:model Name [-m] [-f] [-s] [-c] [--api] [--all] [--table=] [--soft-deletes] - MakeRequestCommand
-
make:request Name - MakeSeederCommand
-
make:seeder Name - MakeTestCommand
-
make:test Name [--unit] - McpInstallCommand
-
mcp:install [--guidelines=AGENTS.md] [--force]: registers the MCP server for AI agents and writes their Daravel guidelines. - McpServeCommand
-
mcp:serve [--allow-write]: a Model Context Protocol server on stdio for AI coding agents (Claude Code, Cursor, ...), bound to this project. - McpServer
- A Model Context Protocol server (JSON-RPC 2.0) that gives AI coding agents the project's routes, database schema, conventions and guide.
- McpTool
-
A tool a package adds to
mcp:serve(daravel_redis'sredis_inspect), offered by one of its commands (McpToolSource). - McpToolSource
-
A command that brings MCP tools:
mcp:serveoffers the tools of every registered command that is one, so a package adds tools through the commands it already registers inbootstrap/commands.dart. - MigrateCommand
-
dartisan migrate— runs pending migrations. - MigrateFreshCommand
-
dartisan migrate:fresh [--seed]— drops all tables and migrates. - MigrateResetCommand
-
dartisan migrate:reset— rolls back every migration. - MigrateRollbackCommand
-
dartisan migrate:rollback— rolls back the last batch(es). - MigrateStatusCommand
-
dartisan migrate:status— shows ran/pending migrations. - ModelShowCommand
-
model:show <Model> [--json]— a model's table, attributes and relations (Laravel 11), frombootstrap/models.dart. - ModelSource
-
What
model:syncneeds from a model source file. - ModelSyncCommand
-
model:sync [Model] [--dry-run]— rewrites the accessor region of models from the database schema (BLUEPRINT_V2 §8.3). - Naming
- Naming helpers shared by generators.
- NewCommand
-
new <name> [--template=api|minimal] [--path=<repo>] [--git] [--no-pub] - OpenApiGenerateCommand
-
openapi:generate [--output=openapi.json] - PackageManifest
- One first-party package and its installation.
- PathSource
- Local checkout of the framework repository (contributors, CI).
- ProbeResponse
- A response as the checks see it: status, headers (lower-case names) and the start of the body.
- ProjectPaths
-
Locates a Daravel project (BLUEPRINT_V2 §8.3): a directory with a
pubspec.yamland abootstrap/folder. - Prompter
- Asks the person at the terminal; tests answer with a fake.
- PubAddCommand
-
pub:add <name>... [--yes] [--no-get](alsoinstall): adds packages and wires them into the project. - PubHostedSource
-
Published packages on pub.dev (default): a plain
pubspec.yamlwithout overrides, like any other application. - PubListCommand
-
pub:list: the first-party packages and whether the project has them. - PubSearchCommand
-
pub:search <words> [--online]. - QueueClearCommand
-
queue:clear [connection] [--queue=]— deletes pending jobs. - QueueContinueCommand
-
queue:continue [connection:]queue— resumes a paused queue. - QueueFailedCommand
-
queue:failed— lists failed jobs. - QueueFlushCommand
-
queue:flush [--hours=N]— deletes failed jobs. - QueueForgetCommand
-
queue:forget <id>— deletes a failed job. - QueuePauseCommand
-
queue:pause [connection:]queue— workers stop taking jobs from the queue (running jobs finish) untilqueue:continue. - QueueRestartCommand
- QueueRetryCommand
-
queue:retry <id|uuid|all>— pushes failed jobs back onto the queue. - QueueWorkCommand
-
queue:work— processes jobs until stopped. - RedisInstallCommand
-
redis:install [--docker] [--server=valkey|redis]: adds daravel_redis to the project, registers.withRedis()and its commands, documents its.envkeys and, with--docker, a Valkey (or Redis) service. - RegistryPatcher
-
Inserts import and entry lines into registry files that carry
// <dartisan:imports>and// <dartisan:entries>regions (ADR-002). Idempotent: existing lines are not duplicated; imports stay sorted. - RouteDiff
-
Laravel's routes against Daravel's, for a migration route by route
(the strangler fig pattern, Blueprint #29): which Laravel routes
Daravel answers already, which still go to Laravel through
withUpstream, and which exist in Daravel only. - RouteDiffCommand
-
route:diff (--laravel=<dir> | --laravel-json=<file>) [--json]: Laravel's routes against this application's (RouteDiff). - RouteListCommand
-
dartisan route:list— prints the compiled route table. - ScheduleListCommand
-
schedule:list— prints the schedule. - ScheduleRunCommand
-
schedule:run— runs the tasks due this minute. - ScheduleWorkCommand
-
schedule:work— runs the scheduler loop in the foreground. - SecurityAudit
- A black-box audit of a running Daravel (or any HTTP) server: single, harmless requests (GET, HEAD, OPTIONS, TRACE and a small POST), no floods and no exploitation, so it can run against a staging server.
- SecurityAuditCommand
-
security:audit [--target=URL] [--format=terminal|json|sarif] [--output=FILE] [--severity=high] [--only=ids] [--json-path=/api/...]: a black-box audit of a running server (SecurityAudit). It exits 1 when a finding reaches--severity, so CI can gate on it. - SelectorState
-
The interactive list of
pub:add: a filter typed as text, a cursor, and the ticked options. Pure, so it is tested without a terminal. - SelfUpdateCommand
-
dartisan self-update: activates the latest (or--to) globaldartisan_cli. - ServeCommand
-
dartisan serve— starts the HTTP server. - ServiceCalls
- One service's round trips: a Prometheus histogram.
- StorageLinkCommand
-
storage:link [--force]— createspublic/storage→storage/app/public. - StressResult
- The rounds of a scenario, summarised.
- StressRound
- One round of one scenario.
- StressScenario
-
One kind of request
test:stresssends, and the statuses it expects. - StubPublishCommand
-
stub:publish [--force]— copies the generator templates tostubs/. - TerminalPrompter
- Questions on stdin: arrow keys and space in a terminal that allows raw input, numbers typed otherwise (CI, Git Bash's mintty).
- TestCommand
-
test [--conformance] [--security] [--coverage] [-- dart test args]— runs the project's tests withdart test. - TestE2eCommand
-
test:e2e [--api] [--ui] [--serve] [--url] [-- playwright args]: runs the Playwright suite. - TestStressCommand
-
test:stress: load against a running application, in rounds, with a pass or fail for CI (Blueprint #45). - TinkerCommand
-
tinker "<expression>"— evaluates a Dart expression inside the booted application and prints the result (models and collections as JSON): - TransferReport
- What DatabaseTransfer.run did (or would do, for a dry run).
- UpCommand
-
up— brings the application out of maintenance mode. - UpgradeCommand
-
dartisan upgrade: moves a project, and the global CLI, to a Daravel release (BLUEPRINT #12).
Enums
- AuditSeverity
-
How bad a finding is;
--severityfails the audit at or above one. - CheckStatus
-
One
doctorfinding. - ReloadAction
- How a set of file changes is applied (ADR-010).
- SelectorKey
- Keys the selector understands.
Constants
-
adoptedEnvKeys
→ const List<
String> -
Settings copied from the Laravel
.envso both applications share the database, the encryption key and the password hashing parameters. -
builtInStubs
→ const Map<
String, String> - Stub name → template.
-
clientStates
→ const List<
String> -
The state adapters
--stateaccepts. -
composeFiles
→ const List<
String> -
The compose files
redis:install --dockerlooks for, in order. -
damSections
→ const List<
String> - Every DAM section buildDam can write, in output order.
-
damUnsupported
→ const List<
String> -
What this exporter does not describe yet; listed in
report.unsupportedso nothing is dropped silently (BLUEPRINT_DARAGIC §5.1). - damVersion → const String
- The DAM (Daravel Application Model) version written by buildDam (BLUEPRINT_DARAGIC §5).
- daravelConventions → const String
-
The
conventionstool: what an agent must know before writing code. -
daravelPackages
→ const List<
String> - The packages released together under one version.
- ddevDartisanCommand → const String
-
.ddev/commands/web/dartisan:ddev dartisan <command>runs the project's CLI in the web container. - dockerignoreTemplate → const String
-
driverPackages
→ const Map<
String, DriverPackage> -
The drivers by
db:installname (aliases included). - e2eDirectory → const String
- Where the Playwright suite lives in a project.
-
mcpDdevServerEntry
→ const Map<
String, Object?> -
The entry for a DDEV project: its packages are resolved inside the web
container, so the server runs there (
ddev dartisan). -
mcpProductionRefused
→ const Set<
String> -
Commands
run_commandrefuses whenAPP_ENV=production. -
mcpProtocolVersions
→ const List<
String> - MCP protocol versions this server speaks, newest first.
-
mcpRefusedCommands
→ const Set<
String> -
Commands
run_commandnever starts: long-running or interactive. -
mcpServerEntry
→ const Map<
String, Object?> -
The
daravelentrymcp:installwrites to.mcp.json. - minimumDartSdk → const (int, int)
- Oldest Dart SDK Daravel supports (keep in sync with every pubspec).
-
officialPackages
→ const List<
PackageManifest> -
The first-party packages, in the order
pub:listshows them. -
reservedAccessors
→ const Set<
String> -
Accessor names that would clash with
Model/Authenticatablemembers or Dart keywords; those columns are skipped with a warning. - Tables a Laravel application shares with Daravel (Laravel coexistence guide); missing ones are reported, not created.
- systemSqliteHooks → const String
-
package:sqlite3's build-hook setting that loads SQLite from the OS instead of bundling it.
Functions
-
actionFor(
Iterable< String> paths) → ReloadAction -
Decides between hot reload and restart for changed
paths(relative to the project root). Boot-time inputs (env, bootstrap registries, routes, migrations, pubspec) require a restart because they are read once. -
adaptValue(
Object? value, String type, SqlDialect dialect) → Object? -
valueread from another database, asdialectstores a column oftype: JSON documents as text, 0/1 as booleans on PostgreSQL, dates as Laravel'sY-m-d H:i:stext on SQLite and MySQL. -
addDependency(
String pubspec, String package, String constraint) → String -
pubspecwithpackage: constraintunderdependencies:, or unchanged when the package is already a dependency. -
addDevDependency(
String pubspec, String package, String constraint) → String -
pubspecwithpackageindev_dependencies:(created when missing), unchanged when it is a dependency already. -
addEnvExample(
String example, DriverPackage driver) → String -
example(.env.example) with a commented block fordriver, once. -
addForceFlag(
ArgParser parser) → void -
The
--forceflag of a destructive command. -
addPackageEnv(
String example, PackageManifest manifest) → String -
example(.env.example) with a commented block formanifest, once. -
addPathDependency(
String pubspec, String package, String daravel) → String -
pubspecwithpackageas a path dependency (a sibling of the localdaravelcheckout atdaravel), unchanged when it is a dependency. -
addRedisService(
String compose, {String server = 'valkey'}) → String -
compose(empty: a new file) with aserverservice (valkeyorredis) and its volume, or unchanged when it runs Redis or Valkey already. -
agentGuidelines(
{String server = 'dart run bin/dartisan.dart mcp:serve'}) → String -
The Daravel section of the agent guidelines (
AGENTS.md);serveris how the MCP server is started. -
auditJson(
AuditResult result) → Map< String, Object?> -
resultas JSON. -
auditSarif(
AuditResult result, {required String version}) → Map< String, Object?> -
resultas SARIF 2.1.0, for GitHub code scanning (github/codeql-action/upload-sarif). Findings point atbootstrap/app.dart, where most of the fixes go, since a URL is not a file of the repository. -
backupSqlite(
DatabaseManager db, String target) → Future< int> -
Copies the SQLite database behind
dbtotargetwithVACUUM INTO: a consistent copy even while the server writes (unlike copying the file, which can catch a write half done), checked withPRAGMA integrity_check. Returns the backup's size in bytes. -
buildDam(
Application app, {Set< String> ? only, String? projectRoot}) → Future<Map< String, Object?> > -
The application as a DAM: structure only, deterministic (entities sorted,
no timestamps), no secrets (
.env.examplekeys and safe defaults only).onlylimits the sections (metaandreportare always there). -
buildOpenApi(
Iterable< RouteEntry> routes, {String title = 'Daravel API', String version = '1.0.0', String? serverUrl}) → Map<String, Object?> -
Builds an OpenAPI 3.1 document from the compiled route table
(
dartisan openapi:generate, the live/docs/apipage). -
canonical(
Object? value) → Object? -
valuewith every map's keys sorted, so the JSON is byte-for-byte stable. -
connectionFromSpec(
String spec, DatabaseConfig config, {required String basePath}) → ConnectionConfig -
The connection
specnames: a configured connection (sqlite,pgsql, ...) or a URL:sqlite:database/old.sqlite,sqlite::memory:,pgsql://user:secret@host:5432/app?sslmode=require,mysql://user@host/app. Relative SQLite paths resolve againstbasePath. -
damLock(
Map< String, Object?> dam) → Map<String, Object?> -
daragic.lock: the DAM version and a SHA-256 per section and per entity, for incremental merges (BLUEPRINT_DARAGIC §5.5). -
daravelPath(
String pubspec) → String? -
Where
pubspectakesdaravelfrom when it is a local checkout (path:underdependenciesordependency_overrides), ornull. -
dartExecutable(
) → String -
The
dartexecutable to spawn (works underdart runand AOT). -
dartTypeFor(
ColumnInfo column, String? cast) → ({String? hint, String type}) - Maps a column to a Dart type: casts win, then the database type. Booleans, dates and JSON without a cast stay raw (with a hint), because SQLite returns them as integers/strings.
-
describeConnection(
ConnectionConfig c) → String - A connection for messages: the driver and database, never a password.
-
describeDatabase(
DatabaseManager db) → Future< List< List< >String> > -
Rows for
db:show: every table with its column and row counts. -
describeRules(
Object value) → List< String> -
A rule value (
'required|email', a list, aRule, aRuleBuilder) as strings in the rule DSL. -
describeTable(
DatabaseManager db, String table) → Future< List< List< ?>String> > -
Rows for
db:table: the columns oftable, ornullwhen it does not exist. -
discoverScenarios(
Uri base, {List< String> paths = const [], DateTime? now}) → Future<(List< StressScenario> , List<String> )> -
The scenarios
test:stresscan run againstbase, found by probing it: the health check,/api/ping, a 404,/api/auth/mewith the token of a synthetic user it registers, a rate-limited login, andpaths. -
dockerfileTemplate(
{bool sqlite = true, bool distroless = false}) → String -
Multi-stage image: Dart SDK builder → slim runtime. SQLite ships inside
the bundle (build hooks), so the runtime needs no libsqlite3 package.
The generated
Dockerfile. Withoutsqlite(an application on PostgreSQL or MySQL) the image leaves the SQLite library out, asdartisan build --no-sqlitedoes. Withdistrolessthe runtime isgcr.io/distroless/cc-debian12:nonroot: glibc and CA certificates, no shell or package manager, thenonrootuser. -
e2eSpec(
String name, {required bool api}) → (String, String) -
A new spec named after
name(AuthFlow→auth_flow): an API spec (specs/api/<name>.api.spec.ts, no browser) or a browser one. -
e2eTemplates(
{bool auth = true}) → Map< String, String> -
The files
e2e:installwrites under e2eDirectory (Blueprint #46).authadds the token specs, for projects with/api/auth/*routes. -
extraMakeCommands(
) → List< Command< int> > -
make:policy,make:event,make:listener,make:resource,make:rule,make:observer,make:provider,make:command,make:test. -
generateClient(
Iterable< RouteEntry> routes, {required String packageName, required String baseUrl, String locale = 'en', String title = 'Daravel', Set<String> states = const <String>{}}) → GeneratedClient -
Builds the client package for
routes. -
hooksPubspec(
String root) → File -
The pubspec whose
hooks.user_definesthe build reads: the project's, or the workspace root's for a workspace member (resolution: workspace). -
installedPackages(
String pubspec) → Map< String, String> -
The packages of
pubspecand their constraints, fromdependenciesanddev_dependencies(path:andgit:entries aspath/git). -
installMcp(
String root, {String guidelines = 'AGENTS.md', bool force = false}) → List< String> -
Registers the
daravelMCP server inroot/.mcp.json(other servers are kept) and writes the Daravel section ofroot/guidelinesbetween markers, so running it again only refreshes that section. -
isDdevProject(
String root) → bool -
Whether
rootis a DDEV project (.ddev/config.yaml). -
laravelVersion(
String root) → String? -
The
laravel/frameworkversion of the project atroot, fromcomposer.lock(ornullwhen it is not a Laravel project). -
levenshtein(
String a, String b) → int -
The number of single-character edits between
aandb. -
lockedVersion(
String lock) → String? -
The
daravelversion inpubspec.lock, or null. -
mcpServerEntryFor(
String root) → Map< String, Object?> -
The
.mcp.jsonentry for the project atroot. -
mcpToolsOf(
CommandRunner< int> ? runner) → List<McpTool> -
The tools of
runner's commands that are McpToolSources. -
modelDetails(
DatabaseManager db, ModelDefinition< Model> model) → Future<Map< String, Object?> > -
describeModelplus the model's database columns (attributes), each with its type, nullability, default, key, and whether it is fillable, hidden or cast; the shape ofartisan model:show --json. -
newProjectFiles(
{required String package, required String appName, required FrameworkSource source, String template = 'api', String? appKey}) → Map< String, String> -
Builds the files of a new project (
dartisan new). -
packageConfigCheck(
String root, {required bool windows}) → DoctorCheck? -
.dart_tool/package_config.jsonwritten bydart pub geton another operating system: Windows paths (file:///C:/...) read on Linux, as whenpub getran on the Windows host of a WSL or DDEV project, or Linux paths read on Windows. The packages then do not resolve at all.nullwhen there is no file or it suits this system. -
parseEnvKeys(
String content) → Map< String, String> -
Reads
KEY=valuepairs from a.envbody (no interpolation). -
parsePicks(
String text, int count, {bool many = false}) → List< int> -
1,3or2as zero-based indexes belowcount; empty for anything unreadable or out of range. -
parseQueueTarget(
String? argument) → (String?, String) -
queue:restart— asks running workers to stop after their current job.[connection:]queueargument ofqueue:pause/queue:continue(Laravel 11 syntax):default,database:emails. -
planAccessors(
ModelSource model, List< ColumnInfo> columns) → AccessorPlan -
Accessor lines for
columns(getters for all, setters except for the primary key and timestamps). -
projectEnvValue(
String root, String key) → String? -
keyfrom the process environment, else from the project's.env. -
pruneBackups(
String directory, int keep) → List< String> -
Deletes all but the newest
keep*.sqlitebackups indirectory(names sort by their timestamp); returns the deleted paths. -
pubDevLatest(
) → Future< String> -
publicStressReport(
List< StressResult> results, {required Map<String, Object?> settings, DateTime? date}) → Map<String, Object?> - What may be published of a run (Blueprint #45, sanitization protocol): built from an allowlist, so the target, tokens, synthetic users, custom paths and host names never reach it. Statuses are given by class.
-
readLogRecords(
String directory, {int count = 20, LogLevel? minLevel}) → List< Map< String, Object?> > -
The newest
countrecords of the daily log files indirectory(LOG_STACKwithdaily), newest last;minLevelfilters by severity. -
readOnlySelect(
DatabaseManager db, String sql, {List< Object?> bindings = const [], int limit = 100}) → Future<({List< Map< rows, bool truncated})>String, Object?> > -
Runs one
SELECT/WITH/EXPLAINstatement that cannot write: inside a transaction that is always rolled back, read-only where the database enforces it (SQLitequery_only, PostgreSQLREAD ONLY; MySQL relies on the statement check and the rollback). At mostlimitrows. -
refuseInProduction(
Application app, ArgResults results, String command) → bool -
Refuses a destructive command under
APP_ENV=productionunless--forcewas given, as artisan does formigrate:rollback,migrate:resetanddb:seed. -
registerDriver(
String source, DriverPackage driver) → String? -
source(bootstrap/app.dart) with the import and the builder calls ofdriver, ornullwhen it has noApplication.configure(...)to add them to. Calls and imports already present are not repeated. -
removeBundledSqlite(
String bundle) → void -
Removes SQLite libraries left in
bundleby an earlier build. -
renderAudit(
AuditResult result, {bool color = false}) → String -
resultas text for a terminal;coloradds ANSI colors. -
renderStressRow(
StressResult result) → String - One line of the terminal table.
-
renderStub(
String template, Map< String, String> values) → String -
Renders
template, replacing every{{ key }}fromvalues. Unknown placeholders are left untouched so mistakes stay visible. -
renderTable(
List< List< rows) → StringString> > - Renders rows as an aligned ASCII table (first row = header).
-
renderTinkerScript(
List< String> imports, String expression) → String -
The program
tinkerruns forexpression, importingimports. -
replaceAccessors(
String source, List< String> lines) → String? -
Replaces the accessor region of
source;nullwhen the markers are missing. -
resolvePackages(
String query) → List< PackageManifest> -
The packages
querynames exactly: an id, a package name or an alias, ignoring case. More than one when an alias is shared (cloud). -
rewriteConstraints(
String pubspec, String version) → ConstraintRewrite -
Sets the hosted constraint of every Daravel package in
dependenciesanddev_dependenciesto^version. Packages fromgit:orpath:are listed inlocaland left alone, and so isdependency_overrides. -
routesUnder(
Iterable< RouteEntry> routes, String prefix) → List<RouteEntry> -
The routes under
prefix(/api), or all of them when none are. -
runDart(
List< String> args, {String? workingDirectory}) → Future<int> -
runStressRound(
Uri base, StressScenario scenario, {required int requests, required int concurrency, int isolates = 1}) → Future< StressRound> -
Sends
requestsrequests ofscenariotobasefromconcurrencyconnections spread overisolatesisolates. -
searchGuide(
String query, {int limit = 5, String locale = 'en'}) → List< Map< String, Object?> > -
The best sections of the guide for
query: headings count three times, every query word must appear.localeidadds the Indonesian pages. -
searchPackages(
String query) → List< PackageManifest> -
The packages matching
querybest first: exact names, then names, titles, categories and descriptions that contain it, then names one or two edits away (a typo). For search and suggestions, never to install. -
searchPubDev(
String query) → Future< List< ({String description, String name, String version})> > -
setEnvValue(
String content, String key, String value) → String -
Sets
KEY=valuein a.envfile body (replacing or appending). -
stressFailures(
List< StressResult> results, {double? maxP95, double? minRps}) → List<String> - Why a run fails: any 5xx, request without a response or unexpected status, and the thresholds. The rate-limited login is held to its statuses only: its latency includes password hashing by design.
-
systemSqliteConfigured(
String root) → bool -
Whether hooksPubspec already has
sqlite3: source: system. -
useSystemSqlite(
String root) → void Function() -
Adds systemSqliteHooks to hooksPubspec and returns a function that
restores the file exactly. When the pubspec already has
hooks:, it must already saysource: system(it is never merged); otherwise this throws. -
watchStopSignals(
void stop()) → Future< void> Function() -
Calls
stoponSIGINTand, outside Windows,SIGTERM(sent by systemd, Docker, Kubernetes and Cloud Run), so long-running workers finish the current job before exiting. Returns a function that removes the handlers. -
writeClient(
GeneratedClient client, String root) → Future< void> -
Writes
clientunderrootand formats it.
Typedefs
- AppFactory = Application Function()
-
Creates an unbooted
Application(a project'screateApp()). -
CommandFactory
= Command<
int> Function(AppFactory createApp) -
Builds a custom command for a project (
bootstrap/commands.dart):SendReportsCommand.new. -
ConstraintRewrite
= ({List<
String> local, String pubspec, List<String> updated}) - The result of rewriteConstraints.
-
DartRunner
= Future<
int> Function(List<String> args, {String? workingDirectory}) -
Runs
dart <args>in a directory and returns its exit code. -
LatestVersion
= Future<
String> Function() -
Reads the latest stable
daravelversion from pub.dev. -
McpCommandRunner
= Future<
({int exitCode, String stderr, String stdout})> Function(String command, List<String> arguments) -
Runs a dartisan command for
run_command: exit code and output. -
ProbeTransport
= Future<
ProbeResponse> Function(String method, String path, {List<int> ? body, Map<String, String> headers}) - Sends one request to the target and returns its response.
-
PubDevSearch
= Future<
List< Function(String query)({String description, String name, String version})> > -
Searches pub.dev: package names for
query, then each one's details. - RouteKey = ({String method, String uri})
- One method and URI of a route.