aws-amplify / aws-amplify/amplify-cli

new command `amplify link` to link local project to existing Amplify app

Open
#11,131 0 comments 7 reactions 0 assignees View on GitHub
feature-request p4 platform
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

### Is this feature request related to a new or existing Amplify category?

New category

### Is this related to another service?

no

### Describe the feature you'd like to request

`amplify link` to essentially run `amplify pull` but only to link the local project to the existing project in AWS, meaning this will generate the necessary gitignored files like `amplify-meta.json` and create `aws-exports.js`

Naming the command `link` aligns with other CLI workflows from the space, and is more explicit about its intentions. In some cases it is required to run pull _and_ init where this command would replace the need for both.

This command would follow a similar flow to other CLI projects:

- https://vercel.com/docs/cli/link
- https://cli.netlify.com/commands/link/

`amplify link --env dev` -> `amplify pull --appId --envName dev && bash headless-init.sh` (where the `init` step is passing environment variables for things like GOOGLE_CLIENT_ID and COGNITO_WEB_CLIENT_ID for OAuth or imported auth)

This change adjusts the intention of each of the 3 commands

- `link` to "link" a local directory to an existing app
- `pull` to "sync" or "pull" changes (e.g. developers are looking to _pull_ their changes made in Studio)
- `init` to _only_ create new projects and _initialize_ the project's resources

### Describe the solution you'd like

see above

### Describe alternatives you've considered

- always run headless pull, then headless init (where necessary)

### Additional context

_No response_

### Is this something that you'd be interested in working on?

- [ ] 👋 I may be able to implement this feature request

### Would this feature include a breaking change?

- [X] ⚠️ This feature might incur a breaking change

Contributor guide

Open the contributing guide

Research direction

Begin with the existing `amplify pull` and `amplify init` command entry points, then inspect the referenced `headless-init.sh` flow. Compare their responsibilities with the proposed `link` behavior, including `--env`; done means a local directory links to an existing app and generates `amplify-meta.json` and `aws-exports.js` without requiring separate pull and init steps.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cli, cloud
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.