> For the complete documentation index, see [llms.txt](https://zenofchain.gitbook.io/sway-bian-cheng-yu-yan-geng-xin-zhong-the-sway-programming-languageupdatin/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zenofchain.gitbook.io/sway-bian-cheng-yu-yan-geng-xin-zhong-the-sway-programming-languageupdatin/1.-dao-yan-introduction/1.4-yi-ge-forc-xiang-mu-aforc-project.md).

# 1.4 一个Forc项目 (A Forc Project)

To initialize a new project with Forc, use `forc new`:\
要使用 Forc 初始化新项目，请使用`forc new`：

```
forc new my-fuel-project

```

Here is the project that Forc has initialized:\
这是 Forc 初始化的项目(目录)：

```
$ cd my-fuel-project
$ tree .
├── Forc.toml
└── src
    └── main.sw

```

`Forc.toml` is the *manifest file* (similar to `Cargo.toml` for Cargo or `package.json` for Node), and defines project metadata such as the project name and dependencies.

`Forc.toml` 是 *manifest 文件*（类似于 Cargo 的`Cargo.toml` 或 Node 的`package.json`），并定义项目的元数据，例如项目名称和依赖。

For additional information on dependency management, see: [here](https://fuellabs.github.io/sway/v0.38.0/book/forc/dependencies.html).\
有关依赖管理的其他信息，请参阅：[此处](https://fuellabs.github.io/sway/v0.38.0/book/forc/dependencies.html)。

```
[project]
authors = ["User"]
entry = "main.sw"
license = "Apache-2.0"
name = "my-fuel-project"

[dependencies]

```

Here are the contents of the only Sway file in the project, and the main entry point, `src/main.sw`:\
以下是项目中唯一的 Sway 文件以及主要入口点 `src/main.sw` 的内容：

```
contract;

abi MyContract {
    fn test_function() -> bool;
}

impl MyContract for Contract {
    fn test_function() -> bool {
        true
    }
}

```

The project is a *contract*, one of four different project types. For additional information on different project types, see [here](https://fuellabs.github.io/sway/v0.38.0/book/sway-program-types/index.html).

该项目是一个 *合约*，是四种不同项目类型之一。有关不同项目类型的更多信息，请参阅[此处](https://fuellabs.github.io/sway/v0.38.0/book/sway-program-types/index.html)。

We now compile our project with `forc build`, passing the flag `--print-finalized-asm` to view the generated assembly:

我们现在使用`forc build`编译我们的项目，传递标志`--print-finalized-asm`以查看生成的程序合集：

```
$ forc build --print-finalized-asm
...
.program:
ji   i4
noop
DATA_SECTION_OFFSET[0..32]
DATA_SECTION_OFFSET[32..64]
lw   $ds $is 1
add  $$ds $$ds $is
lw   $r0 $fp i73              ; load input function selector
lw   $r1 data_0               ; load fn selector for comparison
eq   $r2 $r0 $r1              ; function selector comparison
jnzi $r2 i12                  ; jump to selected function
movi $$tmp i123               ; special code for mismatched selector
rvrt $$tmp                    ; revert if no selectors matched
ret  $one
.data:
data_0 .word 559005003

  Compiled contract "my-fuel-project".
  Bytecode size is 60 bytes.

```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://zenofchain.gitbook.io/sway-bian-cheng-yu-yan-geng-xin-zhong-the-sway-programming-languageupdatin/1.-dao-yan-introduction/1.4-yi-ge-forc-xiang-mu-aforc-project.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
