• Documentation
  • Pricing
© 2026 Serverless, Inc. All rights reserved.

Framework

  • Overview
  • Documentation
  • Plugins360
  • Pricing

Learn

  • Blog
  • GuidesUpdated
  • Examples240
  • Courses

Resources

  • Support
  • Security
  • Trust Center
  • Status

Community

  • Slack
  • GitHub47k
  • Forum
  • Meetups

Company

  • About
  • Careers
  • Contact
  • Partners

Legal

  • Terms of Service
  • Privacy Policy
  • Trademark
  • DMCA
Serverless Framework Logo

Serverless Framework

Intro
SetupUpgrading To V4ConceptsTutorialAWS CredentialsLicense KeysVerifying Downloads
DeployingPackagingBuildingTestingDev ModeServicesFunctions
OverviewHTTP (API Gateway v2)REST (API Gateway v1)ActiveMQApplication Load BalancerAlexa SkillAlexa Smart HomeCloudWatch EventCloudWatch LogCloudFrontCognito User PoolEventBridge EventIoTIoT Fleet ProvisioningKafkaKinesis & DynamoDBMSKRabbitMQS3ScheduleSNSSQSWebsocket
Layers
OverviewTroubleshooting
Managed InstancesWeb Apps (Lambda Web Functions)Sandboxes (Lambda MicroVMs)MCP ServersAlertsVersion PruningDomainsIAM Function PermissionsParameters
OverviewSelf-reference serverless.ymlServerless CoreEnvironment VariablesCLI OptionsExternal YAML/JSON FilesJavascript propertiesGitDoppler
OverviewS3 ObjectsSSM Parameter Store & Secrets ManagerCloudFormation Stack Outputs
OverviewVaultTerraform State Output
ResourcesComposing ServicesDeployment BucketStateAgent SkillsPython support
OverviewRuntimeGatewayMemoryBrowserCode InterpreterDev Mode
API Gateway Proxy
OverviewGeneral ConfigurationAuthenticationAPI KeysData SourcesResolversPipeline FunctionsSubstitutionsCachingDelta SyncCustom DomainWAFCLI Commands
Deploying SAM/CFN TemplatesWorkflow Tips
OverviewCreating PluginsCLI OutputCustom CommandsCustom VariablesExtending the Configuration schemaExtending and overriding configuration
OverviewDashboardAxiom
Overviewagent docsagent inspectagent setupagent skills installagent skills list / readdeploydeploy functiondeploy listdevdiffinfoinvokeinvoke localloginlogin awslogin aws ssologsmetricspackageplugin installplugin uninstallprintprunereconcileremoverollbackrollback functionusage
OverviewConcepts
OverviewMetricsTracesTroubleshoot
OverviewNode.jsPython
OutputsProviders
OverviewBranch DeploymentsPreview DeploymentsCustom ScriptsTestingPrivate PackagesNotificationsMono ReposDeploy in your own CI/CDBest PracticesTroubleshootingFAQ
OverviewSetupToolsAWS Integration
Serverless.yml Reference
Examples and TutorialsConfiguration Validation
  1. CLI Reference
  2. Agent Setup

serverless agent setup

serverless agent setup prepares a machine and a service for AI coding agents: it installs the Agent Skills bundled with the CLI, then reports whether a serverless.yml is here, whether the CLI is signed in, and which AWS account and region a deploy would use, with the fix for each check that fails. It changes nothing in AWS and never prompts. Use it as the first command on a new machine or in a new service; use serverless agent skills install when you only want the skills.

serverless agent setup

The command works in any directory. Outside a service it installs only the user-level serverless-framework skill; run it again in the service directory to install the project skills there.

Options

serverless agent setup accepts these options:

OptionAliasValueDefaultRequiredDescription
--stage-sstringprovider.stage, else devNoThe stage whose AWS credentials to check, as serverless deploy picks them.
--regionstringthe aws resolver's region, else provider.regionNoThe region the AWS check calls AWS STS in.
--aws-profilestringprovider.profile, else AWS_PROFILENoThe AWS profile to check. Ignored when an aws resolver in serverless.yml supplies the credentials.
--dirclaude or agents; repeatable or comma-separateddetectedNoWrite the skills only to .claude/skills (claude, Claude Code) or .agents/skills (agents, the open Agent Skills format), for the user-level and the project skills.

An invalid --dir value exits 1 with Unknown --dir value "<value>". Valid values: claude, agents. serverless agent setup also accepts --config (-c), --debug and --help (-h).

Skills serverless agent setup installs

serverless agent setup writes the same files as serverless agent skills install:

  • The user-level serverless-framework skill, in every directory, into ~/.claude/skills and ~/.agents/skills for the agents found in your home directory (both when none is found), so any agent on the machine knows the Framework in every project. When an installed Claude Code plugin already provides the skill at the bundled version or newer, the command doesn't add a copy to ~/.claude/skills, unless you pass --dir claude; see Skills that Claude Code loads from a plugin.
  • Inside a service directory, the project skills, into the service's .claude/skills and .agents/skills as serverless agent skills install picks them. Each one loads only when a task involves its feature, such as adding an MCP server to the service, so they are installed whether or not the service uses the feature yet. A project skill that an installed Claude Code plugin already provides isn't added to the service's .claude/skills, by the same rules as the user-level skill.

Commit the project skills so teammates' agents get them. serverless deploy and serverless package leave them out of the function package; package.patterns can include them again (see Packaging). A skill is updated only when the bundled version is newer, and a skill whose SKILL.md has no metadata.managed-by: serverless-framework line is skipped as customized. Installed skills update as the CLI updates; see Automatic updates.

Output of serverless agent setup

serverless agent setup writes its report to standard error, in three parts: skills:, environment: and a docs: line. Outside a service directory, signed out, with a default AWS profile:

skills:
  serverless-framework v5 (user) — installed in ~/.claude/skills, ~/.agents/skills

environment:
  service: no serverless.yml in this directory — create one (see the serverless-framework skill), then run "serverless agent setup" again there to install the project skills; or run "serverless" in an interactive terminal to scaffold a project
  auth: not signed in — if the user is at the keyboard, run "serverless login" (without a terminal it prints a sign-in URL for them to open and waits up to 10 minutes); for unattended runs, set SERVERLESS_ACCESS_KEY (create one at https://app.serverless.com/settings/accessKeys) or SERVERLESS_LICENSE_KEY (create one at https://app.serverless.com/settings/licenseKeys)
  aws credentials: profile "default" — account 123456789012, region us-east-1

docs: read ~/.claude/skills/serverless-framework/SKILL.md now; new sessions load it automatically. "serverless agent docs" prints the documentation on demand
  • skills: has one line per skill: installed in or updated in the directories it wrote, up to date, customized by you (no managed-by) — skipped, or target not writable — skipped. After a run that added project skills, a project skills: note says to commit them. Without a home directory, the line skills: user-level install skipped (no home directory available in this environment) replaces the user-level entry. A line such as serverless-mcp: Claude Code loads it from an installed plugin, so it is not installed in .claude/skills — teammates without the plugin get it from "serverless agent setup" reports a skill that an installed Claude Code plugin provides (Skills that Claude Code loads from a plugin).
  • service: reads service: serverless.yml found; AWS credentials checked for stage "dev" in a service directory, naming the configuration file and the stage the AWS check covered.
  • docs: is printed only when the serverless-framework skill is on disk.

Checks serverless agent setup runs

The sign-in and service checks are local. The sign-in check reports the first source the CLI would sign in with, in this order:

  1. An Access Key in the environment: SERVERLESS_ACCESS_KEY, or SERVERLESS_USER_ACCESS_KEY.
  2. Your signed-in session from serverless login.
  3. A License Key in the environment: SERVERLESS_LICENSE_KEY, or SERVERLESS_ORG_ACCESS_KEY.
  4. licenseKey in serverless.yml.
  5. A License Key saved on this machine.

The AWS check finds credentials the way serverless deploy does and makes the same AWS STS account lookup, so the aws credentials: line shows the account and region a deploy would use. When AWS rejects the credentials, the line quotes AWS, names where the credentials came from, and gives the fix. Inside a service, the check uses:

  • the aws resolver a deploy takes credentials from (the one named in provider.resolver, or the service's only type: aws resolver), with its profile, keys and region;
  • otherwise --aws-profile, else provider.profile, else AWS_PROFILE and the rest of the AWS credential chain.

These cases are reported without the AWS call:

  • A provider.profile, a region (provider.region or the resolver's region), or an aws resolver setting written as a variable, such as ${param:awsProfile}: serverless agent setup reads serverless.yml without resolving variables. Run serverless package to check it.
  • AWS credentials from a Serverless Dashboard Provider. When you are signed in or use an Access Key, a deploy uses the org's provider instead of local credentials if one is set up, so the line says so: after the account and region when AWS accepts the local credentials, and after the fix when none are found. The note is left out when the aws resolver sets dashboard: false.

When AWS doesn't answer within 15 seconds, the line says the credentials were not verified, which points to the network rather than the credentials. When AWS can't be reached at all, it says not verified: could not reach AWS (<error>) and asks you to check the network or proxy.

Stages the AWS check covers

The AWS check covers one stage: --stage, else provider.stage, else dev. Stages under stages: whose aws resolver supplies other credentials are listed after the AWS line, without being checked:

  other stages, not checked: "staging" (resolver "aws-account", profile "staging-account") — check one with "serverless agent setup --stage <name>"

Run serverless agent setup --stage <stage> to check one of them. A stage that picks its profile through a variable isn't listed, since serverless agent setup doesn't resolve variables.

Side effects and non-interactive use

serverless agent setup writes only the skill files, under the service directory and your home directory. It reads serverless.yml and .serverlessrc without changing them, makes one AWS STS call, and changes nothing in AWS. It never prompts and needs no sign-in, so it runs the same in a terminal, in CI and under an AI agent.

serverless agent setup exits 0 even when a check fails: the report lines say what needs fixing. It exits 1 for an invalid --dir value, and before it runs when the service's configuration file can't be loaded, for example a serverless.yml that doesn't parse (CONFIGURATION_PARSE_ERROR). It is safe to re-run: a re-run installs what is missing, updates older skills, and reports the environment again.

Examples

Set up a new machine

serverless agent setup

Check the credentials of another stage

serverless agent setup --stage staging

Install the skills only for Claude Code

serverless agent setup --dir claude

Related commands

  • serverless agent skills install: install or update the skills without the environment report.
  • serverless agent docs: print the documentation bundled with the CLI.
  • serverless login: sign in to the Serverless Framework.
Edit this page
Prev agent inspectNextagent skills install

Contents

  • serverless agent setup
  • Options
  • Skills serverless agent setup installs
  • Output of serverless agent setup
  • Checks serverless agent setup runs
  • Stages the AWS check covers
  • Side effects and non-interactive use
  • Examples
  • Set up a new machine
  • Check the credentials of another stage
  • Install the skills only for Claude Code
  • Related commands

Related

GuidesPluginsExamplesSlack CommunitySupport