You must first generate a new project before using workspaces:
ng new my-app
Generate a new project:
ng g application my-project
Generate a new lib:
ng g lib my-lib
Generate a new component within a project:
ng g c my-component --project my-project
It's the same to generate a new component within a lib:
ng g c my-component --project my-lib
Generate a new service within a project:
ng g s my-service --project my-project
It's the same to generate a new service within a lib:
ng g s my-service --project my-lib
Serve the root application:
ng s
Serve a project:
ng s my-project
Build the root application:
ng b
Buid a project:
ng b my-project
Buid a lib:
ng b my-lib