Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ The CLI then asks you for the following:
1. Select a type of Actor to create: web scraper, AI agent, API and data pipeline, or browser automation. Let's choose **web scraper**.
1. Choose the programming language: JavaScript, TypeScript, or Python. Let's choose **JavaScript**.
1. Based on your choice, the CLI suggests Actor templates. For this tutorial, let's choose **Crawlee and Cheerio**.
1. Choose how the source code is set up: local only, or hosted on GitHub, GitLab, or Bitbucket. Let's choose **Local only**, which keeps everything on this machine.

:::tip Explore Actor templates

Expand Down
12 changes: 7 additions & 5 deletions docs/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,13 @@ FLAGS
dependencies.
--skip-git-init Skip initializing a git
repository in the Actor directory.
--source=<option> Where the Actor source
code will live. With a Git provider, Apify creates
the repository on your connected account from the
template, clones it here, and creates an Actor that
builds from it.
--source=<option> How the Actor source
code is set up. "apify" keeps everything on this
machine and uploads nothing, so you deploy it with
"apify push". With a Git provider, Apify creates a
private repository on your connected account from
the template, clones it into the Actor directory,
and creates an Actor that builds from it.
<options: apify|github|gitlab|bitbucket>
-t, --template=<value> Template for the
Actor. If not provided, the command will prompt for
Expand Down
7 changes: 4 additions & 3 deletions src/commands/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,12 @@ export class CreateCommand extends ApifyCommand<typeof CreateCommand> {
static override interactive = true;

static override interactiveNote =
'Prompts for an Actor name, then guides you through what you want to build, a language, a template, and where the source code lives when they are not provided. To run non-interactively, pass the name and --template; --source defaults to "apify". Use --use-case and --language to narrow the template list.';
'Prompts for an Actor name, then guides you through what you want to build, a language, a template, and how the source code is set up when they are not provided. To run non-interactively, pass the name and --template; --source defaults to "apify". Use --use-case and --language to narrow the template list.';

static override examples = [
{
description: 'Create a new Actor project interactively (guided name, use case, language, and template prompts).',
description:
'Create a new Actor project interactively, with guided prompts for the name, use case, language, template, and source.',
command: 'apify create',
},
{
Expand Down Expand Up @@ -140,7 +141,7 @@ export class CreateCommand extends ApifyCommand<typeof CreateCommand> {
}),
source: Flags.string({
description:
'Where the Actor source code will live. With a Git provider, Apify creates the repository on your connected account from the template, clones it here, and creates an Actor that builds from it.',
'How the Actor source code is set up. "apify" keeps everything on this machine and uploads nothing, so you deploy it with "apify push". With a Git provider, Apify creates a private repository on your connected account from the template, clones it into the Actor directory, and creates an Actor that builds from it.',
choices: [...GIT_SOURCE_CHOICES],
// No default: an omitted flag triggers the wizard prompt, or "apify" when it cannot be asked.
required: false,
Expand Down
24 changes: 16 additions & 8 deletions src/lib/git-source/gitSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type { AuthJSON } from '../types.js';
import { cliDebugPrint } from '../utils/cliDebugPrint.js';
import { CONNECT_TIMEOUT_MS, connectViaConsole } from './connectViaConsole.js';

/** Where a new Actor's source code lives. `apify` is the existing, Git-less path. */
/** How a new Actor's source code is set up. `apify` is the Git-less path: the code stays on this machine. */
export const GIT_SOURCE_CHOICES = ['apify', 'github', 'gitlab', 'bitbucket'] as const;
export type GitSource = (typeof GIT_SOURCE_CHOICES)[number];
export type GitProvider = Exclude<GitSource, 'apify'>;
Expand Down Expand Up @@ -150,14 +150,22 @@ export const getAddWorkspaceUrl = (provider: GitProvider, account?: GitAccount):
/** Final wizard step, mirroring the Console. Skipped when `--source` is passed. */
export const promptGitSource = async (): Promise<GitSource> =>
useSelectFromList<GitSource>({
message: 'Where will the source code live?',
message: 'How do you want to set up the source code?',
choices: [
{ name: 'Apify', value: 'apify', description: 'Deploy with "apify push". No Git provider involved.' },
...GIT_SOURCE_CHOICES.filter(isGitProvider).map((provider) => ({
name: GIT_PROVIDERS[provider].label,
value: provider,
description: `Apify creates a private repository on ${GIT_PROVIDERS[provider].label} and builds the Actor from it.`,
})),
{
name: 'Local only',
value: 'apify',
description: 'Everything stays on this machine and nothing is uploaded. Deploy with "apify push".',
},
...GIT_SOURCE_CHOICES.filter(isGitProvider).map((provider) => {
const { label } = GIT_PROVIDERS[provider];

return {
name: `Host on ${label}`,
value: provider,
description: `Apify creates a private repository on ${label}, clones it into the Actor directory, and creates an Actor that builds from it.`,
};
}),
],
default: 'apify',
loop: false,
Expand Down
Loading